A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-December/123309.html below:

[Python-Dev] Raising OSError concrete classes from errno code

[Python-Dev] Raising OSError concrete classes from errno code [Python-Dev] Raising OSError concrete classes from errno codeSerhiy Storchaka storchaka at gmail.com
Wed Dec 26 09:50:40 CET 2012
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 PyErr_SetFromErrno and
> PyErr_SetFromErrnoWithFilename[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 "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'qwerty'


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4