diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-18 19:47:30 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-18 19:47:30 (GMT) |
commit | bd0850b8575730fb1ea587a64e95c818e9504c13 (patch) | |
tree | 54fd7553ce6a3465af3422e6056f7fd0b4dadfe6 /Modules | |
parent | 7bfe89945b6960bb68e27fd25fea421eee9b1fca (diff) | |
download | cpython-bd0850b8575730fb1ea587a64e95c818e9504c13.zip cpython-bd0850b8575730fb1ea587a64e95c818e9504c13.tar.gz cpython-bd0850b8575730fb1ea587a64e95c818e9504c13.tar.bz2 |
import.c now catchs _Py_stat() exceptions
_Py_stat() now returns -2 if an exception was raised.
Diffstat (limited to 'Modules')
-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); |