From: Stefan Behnel Date: Tue, 9 Mar 2010 13:14:38 +0000 (+0100) Subject: cleanup code for print() function in Py3 X-Git-Tag: 0.13.beta0~319^2~7^2~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b837890100c85e82ad379bf6406c2e51311cd6b;p=cython.git cleanup code for print() function in Py3 --- 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) {