mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-46775: OSError should call winerror_to_errno unconditionally on Windows (GH-32179)
This commit is contained in:
parent
a03a09e068
commit
d0c67ea064
2 changed files with 4 additions and 8 deletions
|
|
@ -1634,14 +1634,7 @@ oserror_parse_args(PyObject **p_args,
|
|||
winerrcode = PyLong_AsLong(*winerror);
|
||||
if (winerrcode == -1 && PyErr_Occurred())
|
||||
return -1;
|
||||
/* Set errno to the corresponding POSIX errno (overriding
|
||||
first argument). Windows Socket error codes (>= 10000)
|
||||
have the same value as their POSIX counterparts.
|
||||
*/
|
||||
if (winerrcode < 10000)
|
||||
errcode = winerror_to_errno(winerrcode);
|
||||
else
|
||||
errcode = winerrcode;
|
||||
errcode = winerror_to_errno(winerrcode);
|
||||
*myerrno = PyLong_FromLong(errcode);
|
||||
if (!*myerrno)
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue