From 519e621cce49d0f6bf3f76ffbe84537ec81b532a Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Wed, 23 May 2007 18:47:08 +0000 Subject: Fix so that _internal.py gets imported when it is needed. Perhaps this will fix the problem with multiple-interpreters not working correctly. --- numpy/core/src/arrayobject.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'numpy/core/src/arrayobject.c') diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index c774ae5a2..d86ec6171 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -6131,6 +6131,9 @@ array_dataptr_get(PyArrayObject *self) static PyObject * array_ctypes_get(PyArrayObject *self) { + PyObject *_numpy_internal; + _numpy_internal = PyImport_ImportModule("numpy.core._internal"); + if (_numpy_internal == NULL) return NULL; return PyObject_CallMethod(_numpy_internal, "_ctypes", "ON", self, PyLong_FromVoidPtr(self->data)); @@ -10844,6 +10847,7 @@ static PyObject * arraydescr_protocol_descr_get(PyArray_Descr *self) { PyObject *dobj, *res; + PyObject *_numpy_internal; if (self->names == NULL) { /* get default */ @@ -10858,6 +10862,8 @@ arraydescr_protocol_descr_get(PyArray_Descr *self) return res; } + _numpy_internal = PyImport_ImportModule("numpy.core._internal"); + if (_numpy_internal == NULL) return NULL; return PyObject_CallMethod(_numpy_internal, "_array_descr", "O", self); } @@ -11637,12 +11643,6 @@ static PyTypeObject PyArrayDescr_Type = { /** Array Flags Object **/ -typedef struct PyArrayFlagsObject { - PyObject_HEAD - PyObject *arr; - int flags; -} PyArrayFlagsObject; - /*OBJECT_API Get New ArrayFlagsObject */ -- cgit v1.2.1