[pypy-svn] r63049 - pypy/trunk/pypy/module/pyexpat

afa at codespeak.net afa at codespeak.net
Wed Mar 18 18:45:32 CET 2009


Author: afa
Date: Wed Mar 18 18:45:29 2009
New Revision: 63049

Modified:
   pypy/trunk/pypy/module/pyexpat/interp_pyexpat.py
Log:
Translation fixes. Now pypy-c passes test_sax.


Modified: pypy/trunk/pypy/module/pyexpat/interp_pyexpat.py
==============================================================================
--- pypy/trunk/pypy/module/pyexpat/interp_pyexpat.py	(original)
+++ pypy/trunk/pypy/module/pyexpat/interp_pyexpat.py	Wed Mar 18 18:45:29 2009
@@ -282,9 +282,6 @@
                     rffi.cast(rffi.CHAR, namespace_separator))
             else:
                 self.itself = XML_ParserCreate(self.encoding)
-            if not self.itself:
-                raise OperationError(space.w_RuntimeError,
-                                     space.wrap('XML_ParserCreate failed'))
 
         self.handlers = [None] * NB_HANDLERS
 
@@ -464,7 +461,7 @@
         else:
             encoding = space.str_w(w_encoding)
 
-        parser = W_XMLParserType(encoding, '\0', space.newdict(),
+        parser = W_XMLParserType(encoding, 0, space.newdict(),
                                  _from_external_entity=True)
         parser.itself = XML_ExternalEntityParserCreate(self.itself,
                                                        context, encoding)
@@ -597,6 +594,10 @@
         w_intern = space.newdict()
 
     parser = W_XMLParserType(encoding, namespace_separator, w_intern)
+    if not parser.itself:
+        raise OperationError(space.w_RuntimeError,
+                             space.wrap('XML_ParserCreate failed'))
+
     global_storage.get_nonmoving_id(
         CallbackData(space, parser),
         id=rffi.cast(lltype.Signed, parser.itself))



More information about the Pypy-commit mailing list