[pypy-commit] pypy space-newtext: pyexpat

cfbolz pypy.commits at gmail.com
Mon Nov 7 08:53:48 EST 2016


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: space-newtext
Changeset: r88173:39100ec8a0e5
Date: 2016-11-07 14:53 +0100
http://bitbucket.org/pypy/pypy/changeset/39100ec8a0e5/

Log:	pyexpat

diff --git a/pypy/module/pyexpat/interp_pyexpat.py b/pypy/module/pyexpat/interp_pyexpat.py
--- a/pypy/module/pyexpat/interp_pyexpat.py
+++ b/pypy/module/pyexpat/interp_pyexpat.py
@@ -256,9 +256,10 @@
                 'w_arg%d = parser.w_convert_model(space, arg%d)' % (i, i))
             converters.append(
                 'XML_FreeContentModel(parser.itself, arg%d)' % (i,))
+        elif ARG == rffi.INT:
+            converters.append("w_arg%d = space.newint(arg%d)" % (i, i))
         else:
-            converters.append(
-                'w_arg%d = space.wrap(arg%d)' % (i, i))
+            assert 0, "missing conversion case"
         real_params.append(ARG)
     converters = '; '.join(converters)
 
@@ -408,13 +409,13 @@
     'XML_ExpatVersion', [], rffi.CCHARP)
 
 def get_expat_version(space):
-    return space.wrap(rffi.charp2str(XML_ExpatVersion()))
+    return space.newtext(rffi.charp2str(XML_ExpatVersion()))
 
 def get_expat_version_info(space):
     return space.newtuple([
-        space.wrap(XML_MAJOR_VERSION),
-        space.wrap(XML_MINOR_VERSION),
-        space.wrap(XML_MICRO_VERSION)])
+        space.newint(XML_MAJOR_VERSION),
+        space.newint(XML_MINOR_VERSION),
+        space.newint(XML_MICRO_VERSION)])
 
 class Cache:
     def __init__(self, space):
@@ -545,8 +546,8 @@
         children = [self.w_convert_model(space, model.c_children[i])
                     for i in range(model.c_numchildren)]
         return space.newtuple([
-            space.wrap(model.c_type),
-            space.wrap(model.c_quant),
+            space.newint(model.c_type),
+            space.newint(model.c_quant),
             self.w_convert_charp(space, model.c_name),
             space.newtuple(children)])
 


More information about the pypy-commit mailing list