summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2020-01-07 19:44:08 +0000
committerEric Wieser <wieser.eric@gmail.com>2020-01-07 20:51:27 +0000
commit3a42d5b3b329f013c8248a18820f9a5dd5cb8d5d (patch)
tree4ff6e9f83638c3066b8944956dee7fcf4e5bbd46 /numpy
parentb8c97439106f6723c86543056499cde93061aff5 (diff)
downloadnumpy-3a42d5b3b329f013c8248a18820f9a5dd5cb8d5d.tar.gz
MAINT: Eliminate a repeated conversion
We already converted the pyobject to a string on a previous line, there's no need to do it again.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/descriptor.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 21ca576dd..68a7a7f42 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -1712,17 +1712,11 @@ _convert_from_bytes(PyObject *obj, PyArray_Descr **at)
}
/* Check for a deprecated Numeric-style typecode */
- char *type = NULL;
- Py_ssize_t len = 0;
char *dep_tps[] = {"Bool", "Complex", "Float", "Int",
"Object0", "String0", "Timedelta64",
"Unicode0", "UInt", "Void0"};
int ndep_tps = sizeof(dep_tps) / sizeof(dep_tps[0]);
int i;
-
- if (PyBytes_AsStringAndSize(obj, &type, &len) < 0) {
- goto error;
- }
for (i = 0; i < ndep_tps; ++i) {
char *dep_tp = dep_tps[i];