[pypy-commit] pypy cpyext-injection: fix from merge, restore injection typedef override

mattip pypy.commits at gmail.com
Sat Jul 1 08:58:58 EDT 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: cpyext-injection
Changeset: r91663:ed5b90a93109
Date: 2017-06-30 17:12 -0400
http://bitbucket.org/pypy/pypy/changeset/ed5b90a93109/

Log:	fix from merge, restore injection typedef override

diff --git a/pypy/module/cpyext/injection/numpy.py b/pypy/module/cpyext/injection/numpy.py
--- a/pypy/module/cpyext/injection/numpy.py
+++ b/pypy/module/cpyext/injection/numpy.py
@@ -52,7 +52,7 @@
     return w_obj
 
 @bootstrap_function
-def init_mything(space):
+def init_arrayobject(space):
     make_typedescr(W_ArrayObject.typedef,
                    basestruct=PyArrayObject.TO,
                    realize=array_realize)
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -506,6 +506,8 @@
         W_TypeObject.__init__(self, space, name,
             bases_w or [space.w_object], dict_w, force_new_layout=new_layout,
             is_heaptype=flag_heaptype)
+        if newtypedef is not None:
+            self.layout.typedef = newtypedef
         self.flag_cpytype = True
         # if a sequence or a mapping, then set the flag to force it
         if pto.c_tp_as_sequence and pto.c_tp_as_sequence.c_sq_item:


More information about the pypy-commit mailing list