Author: Jean-Paul Calderone <[email protected]>
Branch: py3.5
Changeset: r92155:cce9378e5bb7
Date: 2017-08-15 13:34 -0400
http://bitbucket.org/pypy/pypy/changeset/cce9378e5bb7/
Log: Only expose OSError.winerror on Win32.
diff --git a/pypy/module/exceptions/interp_exceptions.py
b/pypy/module/exceptions/interp_exceptions.py
--- a/pypy/module/exceptions/interp_exceptions.py
+++ b/pypy/module/exceptions/interp_exceptions.py
@@ -636,6 +636,14 @@
else:
WINERROR_TO_ERRNO, DEFAULT_WIN32_ERRNO = {}, 22 # EINVAL
+if rwin32.WIN32:
+ _winerror_property = dict(
+ winerror = readwrite_attrproperty_w('w_winerror', W_OSError),
+ )
+else:
+ _winerror_property = dict()
+
+
W_OSError.typedef = TypeDef(
'OSError',
W_Exception.typedef,
@@ -648,9 +656,9 @@
strerror = readwrite_attrproperty_w('w_strerror', W_OSError),
filename = readwrite_attrproperty_w('w_filename', W_OSError),
filename2= readwrite_attrproperty_w('w_filename2',W_OSError),
- winerror = readwrite_attrproperty_w('w_winerror', W_OSError),
characters_written = GetSetProperty(W_OSError.descr_get_written,
W_OSError.descr_set_written),
+ **_winerror_property
)
W_BlockingIOError = _new_exception(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit