mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Raise ImportError if pyexpat's version is incompatible
This commit is contained in:
commit
7b31b1a2a4
1 changed files with 5 additions and 3 deletions
|
@ -3511,11 +3511,13 @@ PyInit__elementtree(void)
|
|||
expat_capi->MAJOR_VERSION != XML_MAJOR_VERSION ||
|
||||
expat_capi->MINOR_VERSION != XML_MINOR_VERSION ||
|
||||
expat_capi->MICRO_VERSION != XML_MICRO_VERSION) {
|
||||
expat_capi = NULL;
|
||||
PyErr_SetString(PyExc_ImportError,
|
||||
"pyexpat version is incompatible");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (!expat_capi)
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
elementtree_parseerror_obj = PyErr_NewException(
|
||||
"xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue