changeset: 78152:d896fd0a8ba7 branch: 3.2 parent: 78142:71537aba3a0a user: Eli Bendersky date: Tue Jul 17 14:20:38 2012 +0300 files: Modules/_elementtree.c description: ISsue #14988: restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError diff -r 71537aba3a0a -r d896fd0a8ba7 Modules/_elementtree.c --- a/Modules/_elementtree.c Mon Jul 16 15:48:30 2012 -0700 +++ b/Modules/_elementtree.c Tue Jul 17 14:20:38 2012 +0300 @@ -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(

AltStyle によって変換されたページ (->オリジナル) /