]> granicus.if.org Git - python/commitdiff
Fix a refcount bug in an obscure code corner.
authorThomas Heller <theller@ctypes.org>
Mon, 7 Jun 2004 15:04:10 +0000 (15:04 +0000)
committerThomas Heller <theller@ctypes.org>
Mon, 7 Jun 2004 15:04:10 +0000 (15:04 +0000)
Already backported.

Python/import.c

index 030142ad8f7e6378ec8e4fa684fcee7c05c614ed..d4c9e2e40ac1500ed4b42d83629b5fa3ef937fbd 100644 (file)
@@ -921,6 +921,7 @@ load_package(char *name, char *pathname)
        if (fdp == NULL) {
                if (PyErr_ExceptionMatches(PyExc_ImportError)) {
                        PyErr_Clear();
+                       Py_INCREF(m);
                }
                else
                        m = NULL;