summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-05-23 18:47:08 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-05-23 18:47:08 +0000
commit519e621cce49d0f6bf3f76ffbe84537ec81b532a (patch)
tree86b63054239ac6c657911bff197c159c1dfa6441 /numpy/core/src/arraymethods.c
parent5b87029e229fa3dcf0e81231899c36bd52a7616c (diff)
downloadnumpy-519e621cce49d0f6bf3f76ffbe84537ec81b532a.tar.gz
Fix so that _internal.py gets imported when it is needed. Perhaps this will fix the problem with multiple-interpreters not working correctly.
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r--numpy/core/src/arraymethods.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index 54bda5d1e..26c45e839 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -872,12 +872,15 @@ array_sort(PyArrayObject *self, PyObject *args, PyObject *kwds)
if (order == Py_None) order = NULL;
if (order != NULL) {
PyObject *new_name;
+ PyObject *_numpy_internal;
saved = self->descr;
if (saved->names == NULL) {
PyErr_SetString(PyExc_ValueError, "Cannot specify " \
"order when the array has no fields.");
return NULL;
}
+ _numpy_internal = PyImport_ImportModule("numpy.core._internal");
+ if (_numpy_internal == NULL) return NULL;
new_name = PyObject_CallMethod(_numpy_internal, "_newnames",
"OO", saved, order);
if (new_name == NULL) return NULL;
@@ -914,12 +917,15 @@ array_argsort(PyArrayObject *self, PyObject *args, PyObject *kwds)
if (order == Py_None) order = NULL;
if (order != NULL) {
PyObject *new_name;
+ PyObject *_numpy_internal;
saved = self->descr;
if (saved->names == NULL) {
PyErr_SetString(PyExc_ValueError, "Cannot specify " \
"order when the array has no fields.");
return NULL;
}
+ _numpy_internal = PyImport_ImportModule("numpy.core._internal");
+ if (_numpy_internal == NULL) return NULL;
new_name = PyObject_CallMethod(_numpy_internal, "_newnames",
"OO", saved, order);
if (new_name == NULL) return NULL;