summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2022-03-30 17:31:33 (GMT)
committerGitHub <noreply@github.com>2022-03-30 17:31:33 (GMT)
commitd0c67ea0645b7ad37b867c167882a346a24de641 (patch)
tree281c4ef70cd4d42c177641dd1307ac5aff54ab13 /Objects/exceptions.c
parenta03a09e068435f47d02649dda93988dc44ffaaf1 (diff)
downloadcpython-d0c67ea0645b7ad37b867c167882a346a24de641.zip
cpython-d0c67ea0645b7ad37b867c167882a346a24de641.tar.gz
cpython-d0c67ea0645b7ad37b867c167882a346a24de641.tar.bz2
bpo-46775: OSError should call winerror_to_errno unconditionally on Windows (GH-32179)
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 9dbbd40..df10a3c 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -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;