https://github.com/python/cpython/commit/11cc289490b7b275fc0a033e2b376a8d4c780d9b commit: 11cc289490b7b275fc0a033e2b376a8d4c780d9b branch: master author: Neil Schemenauer <nas-github at arctrix.com> committer: GitHub <noreply at github.com> date: 2017年12月07日T16:24:59-08:00 summary: Fix missing DECREF of mod. (#4749) files: M Python/import.c diff --git a/Python/import.c b/Python/import.c index cc7417ba84e..dc79685abd4 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1735,6 +1735,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, } } else { + Py_XDECREF(mod); mod = import_find_and_load(abs_name); if (mod == NULL) { goto error;