diff options
Diffstat (limited to 'Modules/_fileio.c')
-rw-r--r-- | Modules/_fileio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_fileio.c b/Modules/_fileio.c index 81ca202..3b0f81b 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -262,7 +262,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) #endif self->fd = open(name, flags, 0666); Py_END_ALLOW_THREADS - if (self->fd < 0 || dircheck(self) < 0) { + if (self->fd < 0) { #ifdef MS_WINDOWS PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); #else @@ -270,6 +270,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) #endif goto error; } + if(dircheck(self) < 0) + goto error; } goto done; |