diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-16 07:46:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-16 07:46:38 (GMT) |
commit | 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (patch) | |
tree | c1b3aacf87240d393666321d49a5abde3e1d601f /Modules/_io/fileio.c | |
parent | fdbd01151dbd5feea3e4c0316d102db3d2a2a412 (diff) | |
download | cpython-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/_io/fileio.c')
-rw-r--r-- | Modules/_io/fileio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 3c0b752..922db3e 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -123,7 +123,7 @@ internal_close(fileio *self) } if (err < 0) { errno = save_errno; - PyErr_SetFromErrno(PyExc_IOError); + PyErr_SetFromErrno(PyExc_OSError); return -1; } return 0; @@ -456,7 +456,7 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, directories, so we need a check. */ if (S_ISDIR(fdfstat.st_mode)) { errno = EISDIR; - PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, nameobj); + PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, nameobj); goto error; } #endif /* defined(S_ISDIR) */ @@ -910,7 +910,7 @@ portable_lseek(int fd, PyObject *posobj, int whence) _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS if (res < 0) - return PyErr_SetFromErrno(PyExc_IOError); + return PyErr_SetFromErrno(PyExc_OSError); #if defined(HAVE_LARGEFILE_SUPPORT) return PyLong_FromLongLong(res); @@ -1023,7 +1023,7 @@ _io_FileIO_truncate_impl(fileio *self, PyObject *posobj) if (ret != 0) { Py_DECREF(posobj); - PyErr_SetFromErrno(PyExc_IOError); + PyErr_SetFromErrno(PyExc_OSError); return NULL; } |