mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Raise ImportError if pyexpat's version is incompatible
This commit is contained in:
parent
6e571d699f
commit
ef391ac982
1 changed files with 7 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue