From: Eli Bendersky Date: Tue, 17 Jul 2012 11:20:38 +0000 (+0300) Subject: ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load... X-Git-Tag: v3.3.0b2~176^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66099b0cdcce7ee6d0d384a6f7687499bc67f15e;p=thirdparty%2FPython%2Fcpython.git ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError --- diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 788772113c4e..d734c2637a95 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3117,6 +3117,8 @@ PyInit__elementtree(void) expat_capi->MICRO_VERSION != XML_MICRO_VERSION) expat_capi = NULL; } + if (!expat_capi) + return NULL; #endif elementtree_parseerror_obj = PyErr_NewException(