]> granicus.if.org Git - python/commitdiff
ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load...
authorEli Bendersky <eliben@gmail.com>
Tue, 17 Jul 2012 11:20:38 +0000 (14:20 +0300)
committerEli Bendersky <eliben@gmail.com>
Tue, 17 Jul 2012 11:20:38 +0000 (14:20 +0300)
Modules/_elementtree.c

index 788772113c4e0d12b5fd94fe9eacda74e8f1025a..d734c2637a95604863f6ff0cb78f021b5b11701e 100644 (file)
@@ -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(