[Python-checkins] cpython (3.2): ISsue #14988: restore Python 2's behavior of raising ImportError when unable to

eli.bendersky python-checkins at python.org
Tue Jul 17 13:25:41 CEST 2012


http://hg.python.org/cpython/rev/d896fd0a8ba7
changeset:   78152:d896fd0a8ba7
branch:      3.2
parent:      78142:71537aba3a0a
user:        Eli Bendersky <eliben at gmail.com>
date:        Tue Jul 17 14:20:38 2012 +0300
summary:
  ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError

files:
  Modules/_elementtree.c |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -3117,6 +3117,8 @@
             expat_capi->MICRO_VERSION != XML_MICRO_VERSION)
             expat_capi = NULL;
     }
+    if (!expat_capi)
+        return NULL;
 #endif
 
     elementtree_parseerror_obj = PyErr_NewException(

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list