summaryrefslogtreecommitdiff
path: root/numpy/f2py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2020-09-10 17:47:46 -0600
committerCharles Harris <charlesr.harris@gmail.com>2020-09-10 17:51:51 -0600
commit997114d6fe00a37c0f1e7fff976785fc2474917f (patch)
tree93ec579d4c3ec9598cf406e8b07b2c1a1ca84ed2 /numpy/f2py
parent920afc720abe5065e164d14fd732a4b5e8fdc359 (diff)
downloadnumpy-997114d6fe00a37c0f1e7fff976785fc2474917f.tar.gz
MAINT: Replace PyString_Check with PyBytes_Check.
Replaces the npy_3kcompat PyString_Check macro with its definition.
Diffstat (limited to 'numpy/f2py')
-rw-r--r--numpy/f2py/cfuncs.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index 9f5c73a45..2bd0ee2ee 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -436,7 +436,7 @@ cppmacros['GETSTRFROMPYTUPLE'] = """\
PyObject *rv_cb_str = PyTuple_GetItem((tuple),(index));\\
if (rv_cb_str == NULL)\\
goto capi_fail;\\
- if (PyString_Check(rv_cb_str)) {\\
+ if (PyBytes_Check(rv_cb_str)) {\\
str[len-1]='\\0';\\
STRINGCOPYN((str),PyString_AS_STRING((PyStringObject*)rv_cb_str),(len));\\
} else {\\
@@ -655,7 +655,7 @@ fprintf(stderr,\"string_from_pyobj(str='%s',len=%d,inistr='%s',obj=%p)\\n\",(cha
STRINGCOPYN(*str,PyArray_DATA(arr),*len+1);
return 1;
}
- if (PyString_Check(obj)) {
+ if (PyBytes_Check(obj)) {
tmp = obj;
Py_INCREF(tmp);
}
@@ -738,7 +738,7 @@ static int int_from_pyobj(int* v,PyObject *obj,const char *errmess) {
}
if (PyComplex_Check(obj))
tmp = PyObject_GetAttrString(obj,\"real\");
- else if (PyString_Check(obj) || PyUnicode_Check(obj))
+ else if (PyBytes_Check(obj) || PyUnicode_Check(obj))
/*pass*/;
else if (PySequence_Check(obj))
tmp = PySequence_GetItem(obj,0);
@@ -770,7 +770,7 @@ static int long_from_pyobj(long* v,PyObject *obj,const char *errmess) {
}
if (PyComplex_Check(obj))
tmp = PyObject_GetAttrString(obj,\"real\");
- else if (PyString_Check(obj) || PyUnicode_Check(obj))
+ else if (PyBytes_Check(obj) || PyUnicode_Check(obj))
/*pass*/;
else if (PySequence_Check(obj))
tmp = PySequence_GetItem(obj,0);
@@ -807,7 +807,7 @@ static int long_long_from_pyobj(long_long* v,PyObject *obj,const char *errmess)
}
if (PyComplex_Check(obj))
tmp = PyObject_GetAttrString(obj,\"real\");
- else if (PyString_Check(obj) || PyUnicode_Check(obj))
+ else if (PyBytes_Check(obj) || PyUnicode_Check(obj))
/*pass*/;
else if (PySequence_Check(obj))
tmp = PySequence_GetItem(obj,0);
@@ -868,7 +868,7 @@ static int double_from_pyobj(double* v,PyObject *obj,const char *errmess) {
}
if (PyComplex_Check(obj))
tmp = PyObject_GetAttrString(obj,\"real\");
- else if (PyString_Check(obj) || PyUnicode_Check(obj))
+ else if (PyBytes_Check(obj) || PyUnicode_Check(obj))
/*pass*/;
else if (PySequence_Check(obj))
tmp = PySequence_GetItem(obj,0);
@@ -978,7 +978,7 @@ static int complex_double_from_pyobj(complex_double* v,PyObject *obj,const char
(*v).r = PyLong_AsDouble(obj);
return (!PyErr_Occurred());
}
- if (PySequence_Check(obj) && !(PyString_Check(obj) || PyUnicode_Check(obj))) {
+ if (PySequence_Check(obj) && !(PyBytes_Check(obj) || PyUnicode_Check(obj))) {
PyObject *tmp = PySequence_GetItem(obj,0);
if (tmp) {
if (complex_double_from_pyobj(v,tmp,errmess)) {