[Python-Dev] Raising OSError concrete classes from errno code (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Wed Dec 26 09:50:40 CET 2012
- Previous message: [Python-Dev] Raising OSError concrete classes from errno code
- Next message: [Python-Dev] Raising OSError concrete classes from errno code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 25.12.12 23:55, Andrew Svetlov wrote:
Currently we have exception tree of classes inherited from OSError When we use C API we can call PyErrSetFromErrno and PyErrSetFromErrnoWithFilename[Object] functions. This ones raise concrete exception class (FileNotFoundError for example) looking on implicit errno value. I cannot see the way to do it from python.
raise OSError(errno.ENOENT, 'No such file or directory', 'qwerty') Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: 'qwerty'
- Previous message: [Python-Dev] Raising OSError concrete classes from errno code
- Next message: [Python-Dev] Raising OSError concrete classes from errno code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]