From b6817a57e72ae7397dc03f3150f0e9b2466bc368 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 11 Jul 2008 16:40:28 +0200 Subject: [PATCH] only provide a fake PyObject_GetBuffer in Py2.5 and earlier --- Cython/Compiler/ModuleNode.py | 2 ++ 1 file changed, 2 insertions(+) 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") #------------------------------------------------------------------------------------ -- 2.26.2