[pypy-issue] [issue1621] CPyExt: PyObject_GetItem() fails on NumPyPy array objects

mattip tracker at bugs.pypy.org
Wed Oct 9 22:35:48 CEST 2013


mattip <matti.picus at gmail.com> added the comment:

Here is a patch to test as amaury suggested, indeed the test fails with
'multiple bases have instance lay-out conflict'

diff -r d91e484f733e pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py	Wed Oct 09 19:17:04 2013 
+0200
+++ b/pypy/module/cpyext/test/test_typeobject.py	Wed Oct 09 23:33:25 2013 
+0300
@@ -322,6 +322,7 @@
 
 
 class TestTypes(BaseApiTest):
+    spaceconfig = dict(usemodules=['micronumpy', 'cpyext'])
     def test_type_attributes(self, space, api):
         w_class = space.appexec([], """():
             class A(object):
@@ -358,6 +359,13 @@
         assert w_obj is None
         assert api.PyErr_Occurred() is None
 
+    def test_ndarray_ref(self, space, api):
+        w_obj = space.appexec([], """():
+            import numpypy as np
+            return np.int64(2)""")
+        ref = make_ref(space, w_obj)
+        api.Py_DecRef(ref)
+
 class AppTestSlots(AppTestCpythonExtensionBase):
     def test_some_slots(self):
         module = self.import_extension('foo', [

----------
nosy: +mattip
status: chatting -> in-progress

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1621>
________________________________________


More information about the pypy-issue mailing list