summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-07-17 11:20:38 (GMT)
committerEli Bendersky <eliben@gmail.com>2012-07-17 11:20:38 (GMT)
commit66099b0cdcce7ee6d0d384a6f7687499bc67f15e (patch)
treefb285cd264bf37dd35b33664cd58458f9287ed0d /Modules/_elementtree.c
parent954d46b2ccf2c5800b89bd6c8616cafeb39168d6 (diff)
downloadcpython-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/_elementtree.c')
-rw-r--r--Modules/_elementtree.c2
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(