Commit 48188cde authored by Mark Florisson's avatar Mark Florisson

Default to int Py_BuildValue format in py24 for Py_ssize_t

parent 5e42b9f0
...@@ -7136,8 +7136,9 @@ class CythonArrayNode(ExprNode): ...@@ -7136,8 +7136,9 @@ class CythonArrayNode(ExprNode):
code.putln("%s = __pyx_format_from_typeinfo(&%s);" % code.putln("%s = __pyx_format_from_typeinfo(&%s);" %
(format_temp, type_info)) (format_temp, type_info))
code.putln('%s = Py_BuildValue("(%s)", %s);' % (shapes_temp, buildvalue_fmt = " __PYX_BUILD_PY_SSIZE_T " * len(shapes)
"n" * len(shapes), code.putln('%s = Py_BuildValue("(" %s ")", %s);' % (shapes_temp,
buildvalue_fmt,
", ".join(shapes))) ", ".join(shapes)))
err = "!%s || !%s || !PyBytes_AsString(%s)" % (format_temp, err = "!%s || !%s || !PyBytes_AsString(%s)" % (format_temp,
......
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
#define PyNumber_Index(o) PyNumber_Int(o) #define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o) #define PyIndex_Check(o) PyNumber_Check(o)
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#define __PYX_BUILD_PY_SSIZE_T "i"
#else
#define __PYX_BUILD_PY_SSIZE_T "n"
#endif #endif
#if PY_VERSION_HEX < 0x02060000 #if PY_VERSION_HEX < 0x02060000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment