summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-07-04 21:48:16 (GMT)
committerBrett Cannon <brett@python.org>2013-07-04 21:48:16 (GMT)
commit82da8886cc3d8166ab8ef5a257cb04a32ddb1720 (patch)
tree081cfaea38e07f443861716a38c7bc778431153a /Python/import.c
parent45091c0a0c4b759f36a2094d324e9e2022b4106b (diff)
downloadcpython-82da8886cc3d8166ab8ef5a257cb04a32ddb1720.zip
cpython-82da8886cc3d8166ab8ef5a257cb04a32ddb1720.tar.gz
cpython-82da8886cc3d8166ab8ef5a257cb04a32ddb1720.tar.bz2
Issue #15767: Revert 3a50025f1900 for ModuleNotFoundError
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index b9c5924..2e5d205 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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;