diff options
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r-- | Modules/zipimport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index fd89e9b..ed835c9 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -102,6 +102,8 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds) int rv; rv = _Py_stat(filename, &statbuf); + if (rv == -2) + goto error; if (rv == 0) { /* it exists */ if (!S_ISREG(statbuf.st_mode)) @@ -109,8 +111,6 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds) Py_CLEAR(filename); break; } - else if (PyErr_Occurred()) - goto error; Py_CLEAR(filename); /* back up one path element */ flen = PyUnicode_FindChar(path, SEP, 0, flen, -1); |