Fix that ``winerror`` is only present under Windows.
This commit is contained in:
parent
437825a070
commit
30b7174cc2
10
pep-3151.txt
10
pep-3151.txt
|
@ -270,11 +270,11 @@ term, the lesser popularity of OSError is not a problem.
|
|||
Exception attributes
|
||||
--------------------
|
||||
|
||||
Coalescing WindowsError would mean the ``winerror`` attribute would be
|
||||
present on all platforms, just set to ``None`` if the platform
|
||||
isn't Windows. Indeed, ``errno``, ``filename`` and ``strerror`` can all
|
||||
already be None, as is often the case when OSError is raised directly
|
||||
by Python code.
|
||||
Since WindowsError is coalesced into OSError, the latter gains a ``winerror``
|
||||
attribute under Windows. It is set to None under situations where it is not
|
||||
meaningful, as is already the case with the ``errno``, ``filename`` and
|
||||
``strerror`` attributes (for example when OSError is raised directly by
|
||||
Python code).
|
||||
|
||||
Deprecation of names
|
||||
--------------------
|
||||
|
|
Loading…
Reference in New Issue