commit | 66099b0cdcce7ee6d0d384a6f7687499bc67f15e | [log] [tgz] |
---|---|---|
author | Eli Bendersky <eliben@gmail.com> | Tue Jul 17 14:20:38 2012 +0300 |
committer | Eli Bendersky <eliben@gmail.com> | Tue Jul 17 14:20:38 2012 +0300 |
tree | fb285cd264bf37dd35b33664cd58458f9287ed0d | |
parent | 954d46b2ccf2c5800b89bd6c8616cafeb39168d6 [diff] |
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 7887721..d734c26 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c
@@ -3117,6 +3117,8 @@ expat_capi->MICRO_VERSION != XML_MICRO_VERSION) expat_capi = NULL; } + if (!expat_capi) + return NULL; #endif elementtree_parseerror_obj = PyErr_NewException(