Raise ImportError if pyexpat's version is incompatible
This commit is contained in:
parent
6e571d699f
commit
ef391ac982
|
@ -3114,11 +3114,14 @@ PyInit__elementtree(void)
|
|||
expat_capi->size < sizeof(struct PyExpat_CAPI) ||
|
||||
expat_capi->MAJOR_VERSION != XML_MAJOR_VERSION ||
|
||||
expat_capi->MINOR_VERSION != XML_MINOR_VERSION ||
|
||||
expat_capi->MICRO_VERSION != XML_MICRO_VERSION)
|
||||
expat_capi = NULL;
|
||||
}
|
||||
if (!expat_capi)
|
||||
expat_capi->MICRO_VERSION != XML_MICRO_VERSION) {
|
||||
PyErr_SetString(PyExc_ImportError,
|
||||
"pyexpat version is incompatible");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
elementtree_parseerror_obj = PyErr_NewException(
|
||||
|
|
Loading…
Reference in New Issue