summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-06-20 20:26:26 +0300
committerGitHub <noreply@github.com>2020-06-20 20:26:26 +0300
commit5390a021ca3842e237d75e328bd47fb334e647f6 (patch)
treec9288c117c8919d3e36143fc9abfebef0b256a67 /numpy
parent209499058705258d60194f7d06890a6825778d6a (diff)
parent4f5d48f9568febad2ec15e904dbaea0492b2fb0b (diff)
downloadnumpy-5390a021ca3842e237d75e328bd47fb334e647f6.tar.gz
Merge pull request #16642 from eric-wieser/fix-unicode-size
MAINT: Replace `PyUString_GET_SIZE` with `PyUnicode_GetLength`.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/ctors.c2
-rw-r--r--numpy/core/src/multiarray/descriptor.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index c7d149577..ccebe9da6 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -2362,7 +2362,7 @@ _is_default_descr(PyObject *descr, PyObject *typestr) {
return 0;
}
name = PyTuple_GET_ITEM(tuple, 0);
- if (!(PyUString_Check(name) && PyUString_GET_SIZE(name) == 0)) {
+ if (!(PyUnicode_Check(name) && PyUnicode_GetLength(name) == 0)) {
return 0;
}
typestr2 = PyTuple_GET_ITEM(tuple, 1);
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 4ebd5640d..4e37b9628 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -469,7 +469,7 @@ _convert_from_array_descr(PyObject *obj, int align)
/* Insert name into nameslist */
Py_INCREF(name);
- if (PyUString_GET_SIZE(name) == 0) {
+ if (PyUnicode_GetLength(name) == 0) {
Py_DECREF(name);
if (title == NULL) {
name = PyUString_FromFormat("f%d", i);
@@ -478,7 +478,7 @@ _convert_from_array_descr(PyObject *obj, int align)
}
}
/* On Py3, allow only non-empty Unicode strings as field names */
- else if (PyUString_Check(title) && PyUString_GET_SIZE(title) > 0) {
+ else if (PyUnicode_Check(title) && PyUnicode_GetLength(title) > 0) {
name = title;
Py_INCREF(name);
}