diff options
author | Eli Bendersky <eliben@gmail.com> | 2012-07-17 11:20:38 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2012-07-17 11:20:38 (GMT) |
commit | 66099b0cdcce7ee6d0d384a6f7687499bc67f15e (patch) | |
tree | fb285cd264bf37dd35b33664cd58458f9287ed0d /Modules | |
parent | 954d46b2ccf2c5800b89bd6c8616cafeb39168d6 (diff) | |
download | cpython-66099b0cdcce7ee6d0d384a6f7687499bc67f15e.zip cpython-66099b0cdcce7ee6d0d384a6f7687499bc67f15e.tar.gz cpython-66099b0cdcce7ee6d0d384a6f7687499bc67f15e.tar.bz2 |
ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_elementtree.c | 2 |
1 files changed, 2 insertions, 0 deletions
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( |