From: Eli Bendersky Date: Sat, 21 Jul 2012 17:32:39 +0000 (+0300) Subject: Raise ImportError if pyexpat's version is incompatible X-Git-Tag: v3.3.0b2~135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b31b1a2a405ac7273e90a4110c0b7c79acbeb53;p=thirdparty%2FPython%2Fcpython.git Raise ImportError if pyexpat's version is incompatible --- 7b31b1a2a405ac7273e90a4110c0b7c79acbeb53 diff --cc Modules/_elementtree.c index a7201a5fcf0d,c36af5d12616..6f17d800ba80 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@@ -3511,14 -3115,17 +3511,16 @@@ 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; + } -#endif elementtree_parseerror_obj = PyErr_NewException( - "cElementTree.ParseError", PyExc_SyntaxError, NULL + "xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL ); Py_INCREF(elementtree_parseerror_obj); PyModule_AddObject(m, "ParseError", elementtree_parseerror_obj);