From ac456a183926d187c52e7dd80b9212881dd88af5 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 18 Jan 2012 21:35:21 +0100 Subject: [PATCH] Fix some of the remaining test_capi leaks --- Objects/exceptions.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Objects/exceptions.c b/Objects/exceptions.c index fc299f599e6..6529482f1fa 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -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);