diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-06-17 12:14:56 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-06-17 12:16:31 -0700 |
commit | 96add68131c8062ea9bdadd2ffc8caa6cca9c41e (patch) | |
tree | a3cee266f3dc03d183d13c1da736bd23028594e8 | |
parent | 3d9a082d146195944071a81ed0eae9d16976961a (diff) | |
download | numpy-96add68131c8062ea9bdadd2ffc8caa6cca9c41e.tar.gz |
BUG: Don't emit a spurious warning for float_arr['str'], when it will just error anyway
There's no need to convert `a['test']` to `a['t', 'e', 's', 't']` before erroring
Fixes #11364
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 82a0683f9..46ff78b9c 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -233,7 +233,8 @@ unpack_indices(PyObject *index, PyObject **result, npy_intp result_n) || index == Py_None || PySlice_Check(index) || PyArray_Check(index) - || !PySequence_Check(index)) { + || !PySequence_Check(index) + || PyBaseString_Check(index)) { return unpack_scalar(index, result, result_n); } |