diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-05-25 07:22:04 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-05-25 07:22:04 (GMT) |
commit | a6a7a1accfa07c4b2666796c88392c1b1a078bee (patch) | |
tree | 1018c756e2b9248fa95df645d1973c6f34737b9a /Modules/zipimport.c | |
parent | 2d12e1458f0f6af0af350b39552107f2f6fdf363 (diff) | |
download | cpython-a6a7a1accfa07c4b2666796c88392c1b1a078bee.zip cpython-a6a7a1accfa07c4b2666796c88392c1b1a078bee.tar.gz cpython-a6a7a1accfa07c4b2666796c88392c1b1a078bee.tar.bz2 |
return NULL on error
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r-- | Modules/zipimport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index c33ab8b..5ff39bb 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -381,11 +381,12 @@ zipimporter_find_module(PyObject *obj, PyObject *args) return NULL; switch (find_loader(self, fullname, &namespace_portion)) { + case fl_error: + return NULL; case fl_ns_found: /* A namespace portion is not allowed via find_module, so return None. */ Py_DECREF(namespace_portion); /* FALL THROUGH */ - case fl_error: case fl_not_found: result = Py_None; break; @@ -393,7 +394,7 @@ zipimporter_find_module(PyObject *obj, PyObject *args) result = (PyObject *)self; break; } - Py_XINCREF(result); + Py_INCREF(result); return result; } |