From 8b837890100c85e82ad379bf6406c2e51311cd6b Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 9 Mar 2010 14:14:38 +0100 Subject: [PATCH] cleanup code for print() function in Py3 --- Cython/Compiler/Nodes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index cbae1039..253c321f 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -5051,6 +5051,12 @@ static PyObject* %s = 0; static PyObject* %s = 0; #endif """ % (Naming.print_function, Naming.print_function_kwargs), +cleanup = """ +#if PY_MAJOR_VERSION >= 3 +Py_CLEAR(%s); +Py_CLEAR(%s); +#endif +""" % (Naming.print_function, Naming.print_function_kwargs), impl = r""" #if PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { -- 2.26.2