mirror of
https://github.com/python/cpython.git
synced 2025-09-04 07:51:13 +00:00
Issue #15767: Revert 3a50025f1900 for ModuleNotFoundError
This commit is contained in:
parent
45091c0a0c
commit
82da8886cc
10 changed files with 807 additions and 842 deletions
|
@ -1428,8 +1428,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
|
|||
PyObject *msg = PyUnicode_FromFormat("import of %R halted; "
|
||||
"None in sys.modules", abs_name);
|
||||
if (msg != NULL) {
|
||||
PyErr_SetImportErrorSubclass(PyExc_ModuleNotFoundError, msg,
|
||||
abs_name, NULL);
|
||||
PyErr_SetImportError(msg, abs_name, NULL);
|
||||
Py_DECREF(msg);
|
||||
}
|
||||
mod = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue