From: Stefan Behnel Date: Fri, 11 Jul 2008 14:40:28 +0000 (+0200) Subject: only provide a fake PyObject_GetBuffer in Py2.5 and earlier X-Git-Tag: 0.9.8.1~123^2~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b6817a57e72ae7397dc03f3150f0e9b2466bc368;p=cython.git only provide a fake PyObject_GetBuffer in Py2.5 and earlier --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 20237b8e..3dbdf90d 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -2010,6 +2010,7 @@ static void numpy_releasebuffer(PyObject *obj, Py_buffer *view) { types.append((ndarrtype.typeptr_cname, "numpy_getbuffer", "numpy_releasebuffer")) except KeyError: pass + code.putln("#if PY_VERSION_HEX < 0x02060000") code.putln("static int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {") if len(types) > 0: clause = "if" @@ -2030,6 +2031,7 @@ static void numpy_releasebuffer(PyObject *obj, Py_buffer *view) { clause = "else if" code.putln("}") code.putln("") + code.putln("#endif") #------------------------------------------------------------------------------------