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,9 +7136,10 @@ class CythonArrayNode(ExprNode):
code.putln("%s = __pyx_format_from_typeinfo(&%s);" %
(format_temp, type_info))
code.putln('%s = Py_BuildValue("(%s)", %s);' % (shapes_temp,
"n" * len(shapes),
", ".join(shapes)))
buildvalue_fmt = " __PYX_BUILD_PY_SSIZE_T " * len(shapes)
code.putln('%s = Py_BuildValue("(" %s ")", %s);' % (shapes_temp,
buildvalue_fmt,
", ".join(shapes)))
err = "!%s || !%s || !PyBytes_AsString(%s)" % (format_temp,
shapes_temp,
......
......@@ -38,6 +38,9 @@
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#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
#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