Kaydet (Commit) ed33a3f4 authored tarafından Guido van Rossum's avatar Guido van Rossum

whichmodule(): remove redundant PyErr_Clear(); add explicit setting

of error when sys.modules isn't there.
üst 02759c03
......@@ -682,12 +682,11 @@ whichmodule(PyObject *class_map, PyObject *global, PyObject *global_name) {
Py_INCREF(module);
return module;
}
else {
PyErr_Clear();
}
UNLESS(modules_dict = PySys_GetObject("modules"))
UNLESS(modules_dict = PySys_GetObject("modules")) {
PyErr_SetString(PyExc_SystemError, "lost sys.modules");
return NULL;
}
i = 0;
while ((j = PyDict_Next(modules_dict, &i, &name, &module))) {
......
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