cleanup code for print() function in Py3
authorStefan Behnel <scoder@users.berlios.de>
Tue, 9 Mar 2010 13:14:38 +0000 (14:14 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 9 Mar 2010 13:14:38 +0000 (14:14 +0100)
Cython/Compiler/Nodes.py

index cbae103906fc7395d138c3f4fe884a56c95e9504..253c321f2090d384413373f5444580f86876c671 100644 (file)
@@ -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) {