summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-16 07:46:38 (GMT)
committerGitHub <noreply@github.com>2017-04-16 07:46:38 (GMT)
commit55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (patch)
treec1b3aacf87240d393666321d49a5abde3e1d601f /Modules/_multiprocessing
parentfdbd01151dbd5feea3e4c0316d102db3d2a2a412 (diff)
downloadcpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.zip
cpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.gz
cpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.bz2
bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r--Modules/_multiprocessing/multiprocessing.c6
-rw-r--r--Modules/_multiprocessing/semaphore.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index bb65b3b..806e638 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -64,7 +64,7 @@ multiprocessing_closesocket(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
if (ret)
- return PyErr_SetExcFromWindowsErr(PyExc_IOError, WSAGetLastError());
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
Py_RETURN_NONE;
}
@@ -88,7 +88,7 @@ multiprocessing_recv(PyObject *self, PyObject *args)
if (nread < 0) {
Py_DECREF(buf);
- return PyErr_SetExcFromWindowsErr(PyExc_IOError, WSAGetLastError());
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
}
_PyBytes_Resize(&buf, nread);
return buf;
@@ -112,7 +112,7 @@ multiprocessing_send(PyObject *self, PyObject *args)
PyBuffer_Release(&buf);
if (ret < 0)
- return PyErr_SetExcFromWindowsErr(PyExc_IOError, WSAGetLastError());
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
return PyLong_FromLong(ret);
}
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index 9614329..79e8715 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -135,7 +135,7 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
Py_RETURN_TRUE;
case WAIT_OBJECT_0 + 1:
errno = EINTR;
- return PyErr_SetFromErrno(PyExc_IOError);
+ return PyErr_SetFromErrno(PyExc_OSError);
case WAIT_FAILED:
return PyErr_SetFromWindowsErr(0);
default: