diff Python/import.c @ 32294:82fe6832e505 legacy-trunk

Fix a refcount bug in an obscure code corner. Already backported.
author Thomas Heller <theller@ctypes.org>
date Mon, 07 Jun 2004 15:04:10 +0000
parents 56a4ec066621
children 3df36e2e5ddc
line wrap: on
line diff
--- a/Python/import.c	Mon Jun 07 11:20:40 2004 +0000
+++ b/Python/import.c	Mon Jun 07 15:04:10 2004 +0000
@@ -921,6 +921,7 @@
 	if (fdp == NULL) {
 		if (PyErr_ExceptionMatches(PyExc_ImportError)) {
 			PyErr_Clear();
+			Py_INCREF(m);
 		}
 		else
 			m = NULL;