Kaydet (Commit) 7b31b1a2 authored tarafından Eli Bendersky's avatar Eli Bendersky

Raise ImportError if pyexpat's version is incompatible

...@@ -3511,11 +3511,13 @@ PyInit__elementtree(void) ...@@ -3511,11 +3511,13 @@ PyInit__elementtree(void)
expat_capi->MAJOR_VERSION != XML_MAJOR_VERSION || expat_capi->MAJOR_VERSION != XML_MAJOR_VERSION ||
expat_capi->MINOR_VERSION != XML_MINOR_VERSION || expat_capi->MINOR_VERSION != XML_MINOR_VERSION ||
expat_capi->MICRO_VERSION != XML_MICRO_VERSION) { expat_capi->MICRO_VERSION != XML_MICRO_VERSION) {
expat_capi = NULL; PyErr_SetString(PyExc_ImportError,
"pyexpat version is incompatible");
return NULL;
} }
} } else {
if (!expat_capi)
return NULL; return NULL;
}
elementtree_parseerror_obj = PyErr_NewException( elementtree_parseerror_obj = PyErr_NewException(
"xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL "xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment