Skip to content

Commit 66099b0

Browse files
committed
ISsue python#14988: restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError
1 parent 954d46b commit 66099b0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Modules/_elementtree.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3117,6 +3117,8 @@ PyInit__elementtree(void)
31173117
expat_capi->MICRO_VERSION != XML_MICRO_VERSION)
31183118
expat_capi = NULL;
31193119
}
3120+
if (!expat_capi)
3121+
return NULL;
31203122
#endif
31213123

31223124
elementtree_parseerror_obj = PyErr_NewException(

0 commit comments

Comments
 (0)