cython-devel

changeset 1751:df64cbd751ac

enable refnanny for module init function (by Lisandro)
author Stefan Behnel <scoder@users.berlios.de>
date Sun Feb 22 11:24:54 2009 +0100 (2 years ago)
parents cf5aafabcf77
children 1c7195ced95d
files Cython/Compiler/ModuleNode.py
line diff
1.1 --- a/Cython/Compiler/ModuleNode.py Sun Feb 22 00:18:20 2009 +0100 1.2 +++ b/Cython/Compiler/ModuleNode.py Sun Feb 22 11:24:54 2009 +0100 1.3 @@ -1651,11 +1651,9 @@ 1.4 env.use_utility_code(Nodes.traceback_utility_code) 1.5 code.putln("%s = NULL;" % Naming.retval_cname) 1.6 code.put_label(code.return_label) 1.7 - # Disabled because of confusion with refcount of global variables -- run ass2cglobal testcase to see 1.8 - #code.put_finish_refcount_context() 1.9 - code.putln("#if CYTHON_REFNANNY") 1.10 - code.putln("if (__pyx_refchk) {};") 1.11 - code.putln("#endif") 1.12 + 1.13 + code.put_finish_refcount_context() 1.14 + 1.15 code.putln("#if PY_MAJOR_VERSION < 3") 1.16 code.putln("return;") 1.17 code.putln("#else") 1.18 @@ -1793,7 +1791,7 @@ 1.19 for entry in env.var_entries: 1.20 if entry.visibility != 'extern': 1.21 if entry.type.is_pyobject and entry.used: 1.22 - code.put_init_var_to_py_none(entry) 1.23 + code.put_init_var_to_py_none(entry, nanny=False) 1.24 1.25 def generate_c_function_export_code(self, env, code): 1.26 # Generate code to create PyCFunction wrappers for exported C functions.