diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2020-12-31 09:38:40 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2020-12-31 09:38:40 +0900 |
commit | 295fa02e974b890f98bb7bf6a94045c2cd3f5f68 (patch) | |
tree | 2a59dc21aeb4953eb6cbde947296aebbad4f93ba /numpy/core/src/multiarray | |
parent | e0fb9413a32fd2fa984710d904d4f776555a6b5c (diff) | |
download | python-numpy-295fa02e974b890f98bb7bf6a94045c2cd3f5f68.tar.gz python-numpy-295fa02e974b890f98bb7bf6a94045c2cd3f5f68.tar.bz2 python-numpy-295fa02e974b890f98bb7bf6a94045c2cd3f5f68.zip |
Imported Upstream version 1.17.5upstream/1.17.5
Diffstat (limited to 'numpy/core/src/multiarray')
-rw-r--r-- | numpy/core/src/multiarray/multiarraymodule.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index 413decd9d..084a5dd46 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -1581,8 +1581,7 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) PyArrayObject *oparr = NULL, *ret = NULL; npy_bool subok = NPY_FALSE; npy_bool copy = NPY_TRUE; - int nd; - npy_intp ndmin = 0; + int ndmin = 0, nd; PyArray_Descr *type = NULL; PyArray_Descr *oldtype = NULL; NPY_ORDER order = NPY_KEEPORDER; @@ -1644,13 +1643,14 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) ndmin_obj = PyDict_GetItem(kws, npy_ma_str_ndmin); if (ndmin_obj) { - ndmin = PyLong_AsLong(ndmin_obj); - if (error_converting(ndmin)) { + long t = PyLong_AsLong(ndmin_obj); + if (error_converting(t)) { goto clean_type; } - else if (ndmin > NPY_MAXDIMS) { + else if (t > NPY_MAXDIMS) { goto full_path; } + ndmin = t; } /* copy=False with default dtype, order (any is OK) and ndim */ |