mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
return NULL on error
This commit is contained in:
parent
2d12e1458f
commit
a6a7a1accf
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue