diff Python/dynload_win.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 f341b99bb370
children 257cbd2fac38
line wrap: on
line diff
--- a/Python/dynload_win.c	Tue Apr 17 19:58:50 2012 +0200
+++ b/Python/dynload_win.c	Tue Apr 17 16:57:09 2012 -0500
@@ -254,9 +254,9 @@
                         theLength));
             }
             if (message != NULL) {
-                PyErr_SetFromImportErrorWithNameAndPath(message,
-                                        PyUnicode_FromString(shortname),
-                                        pathname);
+                PyErr_SetImportError(message, PyUnicode_FromString(shortname),
+                                     pathname);
+                Py_DECREF(message);
             }
             return NULL;
         } else {