Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 76379:7a32b9380ffd
Fix #14600. Correct reference handling and naming of ImportError convenience function
| author | Brian Curtin <brian@python.org> |
|---|---|
| date | Tue, 17 Apr 2012 16:57:09 -0500 |
| parents | 3b5b4b4bb43c |
| children | 68f9ad6a3b13 |
line wrap: on
line diff
--- a/Python/import.c Tue Apr 17 19:58:50 2012 +0200 +++ b/Python/import.c Tue Apr 17 16:57:09 2012 -0500 @@ -2460,7 +2460,8 @@ 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;
