Author: Antonio Cuni <[email protected]>
Branch:
Changeset: r68315:7f3a776cc72a
Date: 2013-11-25 11:43 +0100
http://bitbucket.org/pypy/pypy/changeset/7f3a776cc72a/
Log: fix test_pass_ndarray_object_to_c by exposing W_NDimArray to C as we
do for all the other builtin types
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -26,6 +26,7 @@
from pypy.module.__builtin__.descriptor import W_Property
from pypy.module.__builtin__.interp_classobj import W_ClassObject
from pypy.module.__builtin__.interp_memoryview import W_MemoryView
+from pypy.module.micronumpy.base import W_NDimArray
from rpython.rlib.entrypoint import entrypoint_lowlevel
from rpython.rlib.rposix import is_valid_fd, validate_fd
from rpython.rlib.unroll import unrolling_iterable
@@ -469,6 +470,7 @@
"Complex": "space.w_complex",
"ByteArray": "space.w_bytearray",
"MemoryView": "space.gettypeobject(W_MemoryView.typedef)",
+ "Array": "space.gettypeobject(W_NDimArray.typedef)",
"BaseObject": "space.w_object",
'None': 'space.type(space.w_None)',
'NotImplemented': 'space.type(space.w_NotImplemented)',
diff --git a/pypy/module/cpyext/src/ndarrayobject.c
b/pypy/module/cpyext/src/ndarrayobject.c
--- a/pypy/module/cpyext/src/ndarrayobject.c
+++ b/pypy/module/cpyext/src/ndarrayobject.c
@@ -3,8 +3,6 @@
#include "numpy/arrayobject.h"
#include <string.h> /* memset, memcpy */
-PyTypeObject PyArray_Type;
-
void
_PyArray_FILLWBYTE(PyObject* obj, int val) {
memset(PyArray_DATA(obj), val, PyArray_NBYTES(obj));
diff --git a/pypy/module/cpyext/test/test_ndarrayobject.py
b/pypy/module/cpyext/test/test_ndarrayobject.py
--- a/pypy/module/cpyext/test/test_ndarrayobject.py
+++ b/pypy/module/cpyext/test/test_ndarrayobject.py
@@ -287,7 +287,6 @@
def test_pass_ndarray_object_to_c(self):
- skip('fixme')
from _numpypy.multiarray import ndarray
mod = self.import_extension('foo', [
("check_array", "METH_VARARGS",
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit