From ddcb49e5f779a9e42356914b9ec4162b722d4ab0 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sun, 16 Feb 2014 15:07:25 -0700 Subject: BUG: #4256: f2py, PyString_FromStringAndSize is undefined in Python3. Use PyUString_FromStringAndSize defined in npy_3kcompat instead. Not using bytes may cause some problems, but strings seem like a better choice. As modules generated with current f2py error out, this particular use is not common and we are free to choose. Closes #4256. --- numpy/f2py/src/fortranobject.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'numpy/f2py/src/fortranobject.h') diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h index 76a357b5e..689f78c92 100644 --- a/numpy/f2py/src/fortranobject.h +++ b/numpy/f2py/src/fortranobject.h @@ -20,6 +20,7 @@ extern "C" { #define PyString_GET_SIZE PyBytes_GET_SIZE #define PyString_AS_STRING PyBytes_AS_STRING #define PyString_FromString PyBytes_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_ConcatAndDel PyBytes_ConcatAndDel #define PyString_AsString PyBytes_AsString @@ -29,6 +30,10 @@ extern "C" { #define PyInt_AsLong PyLong_AsLong #define PyNumber_Int PyNumber_Long + +#else + +#define PyUString_FromStringAndSize PyString_FromStringAndSize #endif -- cgit v1.2.1