summaryrefslogtreecommitdiffstats
path: root/Modules/fcntlmodule.c
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/fcntlmodule.c
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/fcntlmodule.c')
-rw-r--r--Modules/fcntlmodule.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 8875b26..0baaa83 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -79,7 +79,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
ret = fcntl(fd, code, buf);
Py_END_ALLOW_THREADS
if (ret < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
return PyBytes_FromStringAndSize(buf, len);
@@ -99,7 +99,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
ret = fcntl(fd, code, (int)int_arg);
Py_END_ALLOW_THREADS
if (ret < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
return PyLong_FromLong((long)ret);
@@ -210,7 +210,7 @@ fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
}
PyBuffer_Release(&pstr); /* No further access to str below this point */
if (ret < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
if (mutate_arg) {
@@ -238,7 +238,7 @@ fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
Py_END_ALLOW_THREADS
if (ret < 0) {
PyBuffer_Release(&pstr);
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
PyBuffer_Release(&pstr);
@@ -258,7 +258,7 @@ fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
ret = ioctl(fd, code, arg);
Py_END_ALLOW_THREADS
if (ret < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
return PyLong_FromLong((long)ret);
@@ -316,7 +316,7 @@ fcntl_flock_impl(PyObject *module, int fd, int code)
}
#endif /* HAVE_FLOCK */
if (ret < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
Py_RETURN_NONE;
@@ -412,7 +412,7 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
Py_END_ALLOW_THREADS
}
if (ret < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
Py_RETURN_NONE;