From 66099b0cdcce7ee6d0d384a6f7687499bc67f15e Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Tue, 17 Jul 2012 14:20:38 +0300 Subject: ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError --- Modules/_elementtree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 7887721..d734c26 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( -- cgit v0.12