-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Labels
Description
These macros are defined in npy_3kcompat.h and used when compiling for Python 3. The job here is to replace them with their definitions now that we have dropped support for Python 2.7. Note that not all of the current uses are correct, so the code needs to be audited in the course of replacement, global substitution is not the way to go as would make it difficult to track the location of code that needs checking. OTOH, not making making the changes leaves the code less clear than it could be.
- #define PyString_Type PyBytes_Type
- #define PyString_Check PyBytes_Check
- #define PyStringObject PyBytesObject
- #define PyString_FromString PyBytes_FromString
- #define PyString_FromStringAndSize PyBytes_FromStringAndSize
- #define PyString_AS_STRING PyBytes_AS_STRING
- #define PyString_AsStringAndSize PyBytes_AsStringAndSize
- #define PyString_FromFormat PyBytes_FromFormat
- #define PyString_Concat PyBytes_Concat
- #define PyString_ConcatAndDel PyBytes_ConcatAndDel
- #define PyString_AsString PyBytes_AsString
- #define PyString_GET_SIZE PyBytes_GET_SIZE
- #define PyString_Size PyBytes_Size
- #define PyUString_Type PyUnicode_Type
- #define PyUString_Check PyUnicode_Check
- #define PyUStringObject PyUnicodeObject
- #define PyUString_FromString PyUnicode_FromString
- #define PyUString_FromStringAndSize PyUnicode_FromStringAndSize
- #define PyUString_FromFormat PyUnicode_FromFormat
- #define PyUString_Concat PyUnicode_Concat2
- #define PyUString_ConcatAndDel PyUnicode_ConcatAndDel
- #define PyUString_GET_SIZE PyUnicode_GET_SIZE
- #define PyUString_Size PyUnicode_Size
- #define PyUString_InternFromString PyUnicode_InternFromString
- #define PyUString_Format PyUnicode_Format
- #define PyBaseString_Check(obj) (PyUnicode_Check(obj))
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AsLong
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyNumber_Int PyNumber_Long
- PyInt_Check # Inline function.
- #define NpySlice_GetIndicesEx PySlice_GetIndicesEx
- #define Npy_EnterRecursiveCall(x) Py_EnterRecursiveCall(x)
Reactions are currently unavailable