summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-03-14 17:16:36 (GMT)
committerCharles Harris <charlesr.harris@gmail.com>2018-03-15 16:26:20 (GMT)
commit9f3c3540012247aecde1e9bea6c633e48766bc86 (patch)
treef8148d03aa32d41528df4ec7e4f063ccaaf24893
parent020f2ad4e133b7500c7062d89368d38f19e836fd (diff)
downloadpython-numpy-9f3c3540012247aecde1e9bea6c633e48766bc86.zip
python-numpy-9f3c3540012247aecde1e9bea6c633e48766bc86.tar.gz
python-numpy-9f3c3540012247aecde1e9bea6c633e48766bc86.tar.bz2
MAINT: Fix char* variable in arr_add_docstring for Python 3.7
In Python 3.7 the return type of PyUnicode_AsUTF8 has changed from `char *` to `const char *` and the variable the return is stored in needs to match.
-rw-r--r--numpy/core/src/multiarray/compiled_base.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 56bd65e..5ee385c 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -1402,7 +1402,11 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *obj;
PyObject *str;
+ #if (PY_VERSION_HEX >= 0x030700A2)
+ const char *docstr;
+ #else
char *docstr;
+ #endif
static char *msg = "already has a docstring";
PyObject *tp_dict = PyArrayDescr_Type.tp_dict;
PyObject *myobj;