]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix some of the remaining test_capi leaks
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 18 Jan 2012 20:35:21 +0000 (21:35 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 18 Jan 2012 20:35:21 +0000 (21:35 +0100)
Objects/exceptions.c

index fc299f599e6fdc09f8b08859eac932e3835c20e0..6529482f1fafe66427938c5c2229062464002157 100644 (file)
@@ -2400,9 +2400,11 @@ _PyExc_Init(void)
     POST_INIT(BytesWarning)
     POST_INIT(ResourceWarning)
 
-    errnomap = PyDict_New();
-    if (!errnomap)
-        Py_FatalError("Cannot allocate map from errnos to OSError subclasses");
+    if (!errnomap) {
+        errnomap = PyDict_New();
+        if (!errnomap)
+            Py_FatalError("Cannot allocate map from errnos to OSError subclasses");
+    }
 
     /* OSError subclasses */
     POST_INIT(ConnectionError);