From: Eli Bendersky Date: Sat, 21 Jul 2012 17:28:46 +0000 (+0300) Subject: Raise ImportError if pyexpat's version is incompatible X-Git-Tag: v3.3.0b2~135^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef391ac982400f3917037bfaa3a590dc3d61eeb4;p=thirdparty%2FPython%2Fcpython.git Raise ImportError if pyexpat's version is incompatible --- diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index d734c2637a95..c36af5d12616 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -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(