Kaydet (Commit) a6a7a1ac authored tarafından Benjamin Peterson's avatar Benjamin Peterson

return NULL on error

üst 2d12e145
...@@ -381,11 +381,12 @@ zipimporter_find_module(PyObject *obj, PyObject *args) ...@@ -381,11 +381,12 @@ zipimporter_find_module(PyObject *obj, PyObject *args)
return NULL; return NULL;
switch (find_loader(self, fullname, &namespace_portion)) { switch (find_loader(self, fullname, &namespace_portion)) {
case fl_error:
return NULL;
case fl_ns_found: case fl_ns_found:
/* A namespace portion is not allowed via find_module, so return None. */ /* A namespace portion is not allowed via find_module, so return None. */
Py_DECREF(namespace_portion); Py_DECREF(namespace_portion);
/* FALL THROUGH */ /* FALL THROUGH */
case fl_error:
case fl_not_found: case fl_not_found:
result = Py_None; result = Py_None;
break; break;
...@@ -393,7 +394,7 @@ zipimporter_find_module(PyObject *obj, PyObject *args) ...@@ -393,7 +394,7 @@ zipimporter_find_module(PyObject *obj, PyObject *args)
result = (PyObject *)self; result = (PyObject *)self;
break; break;
} }
Py_XINCREF(result); Py_INCREF(result);
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment