diff options
author | Brian Curtin <brian@python.org> | 2012-04-17 21:57:09 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-04-17 21:57:09 (GMT) |
commit | 09b86d1196427f2028d7e072b106847d8c693815 (patch) | |
tree | c06e9fe5b6a732d07f2987ff86081165bd69ebf5 /Python/import.c | |
parent | fba807ac44ff6804dd1be7c3962fc3455c8e7763 (diff) | |
download | cpython-09b86d1196427f2028d7e072b106847d8c693815.zip cpython-09b86d1196427f2028d7e072b106847d8c693815.tar.gz cpython-09b86d1196427f2028d7e072b106847d8c693815.tar.bz2 |
Fix #14600. Correct reference handling and naming of ImportError convenience function
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c index 584f30e..f3de7d8 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2460,7 +2460,8 @@ 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_SetFromImportErrorWithName(msg, abs_name); + PyErr_SetImportError(msg, abs_name, NULL); + Py_DECREF(msg); } mod = NULL; goto error_with_unlock; |