summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-05-01 08:04:02 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-05-01 08:04:02 -0600
commit1c774db1d3b0812fb89556592baca4f95b343f71 (patch)
tree48fc335de4f54e1e76cb81efd248e72b40b5ff83 /numpy
parent63df267fcd5acaf7fc1408dbfef9cc7f53929530 (diff)
parent0816d555463437bd2c7db2ac1c96ca26a31fecf0 (diff)
downloadnumpy-1c774db1d3b0812fb89556592baca4f95b343f71.tar.gz
Merge pull request #4648 from jaimefrio/void-api
BUG: Hold GIL for types with fields, fix #4642
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/descriptor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 46419e48f..8b55c9fbd 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -410,7 +410,8 @@ _convert_from_array_descr(PyObject *obj, int align)
PyObject *nameslist;
PyArray_Descr *new;
PyArray_Descr *conv;
- char dtypeflags = 0;
+ /* Types with fields need the Python C API for field access */
+ char dtypeflags = NPY_NEEDS_PYAPI;
int maxalign = 0;
n = PyList_GET_SIZE(obj);
@@ -599,7 +600,8 @@ _convert_from_list(PyObject *obj, int align)
PyObject *nameslist = NULL;
int ret;
int maxalign = 0;
- char dtypeflags = 0;
+ /* Types with fields need the Python C API for field access */
+ char dtypeflags = NPY_NEEDS_PYAPI;
n = PyList_GET_SIZE(obj);
/*
@@ -935,7 +937,8 @@ _convert_from_dict(PyObject *obj, int align)
int n, i;
int totalsize, itemsize;
int maxalign = 0;
- char dtypeflags = 0;
+ /* Types with fields need the Python C API for field access */
+ char dtypeflags = NPY_NEEDS_PYAPI;
int has_out_of_order_fields = 0;
fields = PyDict_New();