From f8e75a14bb64d88208b847b1f6204585d6e0a1b5 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 27 Oct 2007 14:40:39 +0200 Subject: [PATCH] error handling code was missing --- Cython/Compiler/ModuleNode.py | 6 ++++-- Cython/Compiler/Options.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 74708b24..7fd8ce83 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -166,9 +166,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): entry.name, entry.cname, sig)) - h_code.putln("Py_DECREF(module);") + h_code.putln("Py_DECREF(module); module = 0;") for entry in public_extension_types: - self.generate_type_import_call(entry.type, h_code, "goto bad;") + self.generate_type_import_call( + entry.type, h_code, + "if (!%s) goto bad;" % entry.type.typeptr_cname) h_code.putln("return 0;") h_code.putln("bad:") h_code.putln("Py_XDECREF(module);") diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py index 8c190978..b1f744dc 100644 --- a/Cython/Compiler/Options.py +++ b/Cython/Compiler/Options.py @@ -3,7 +3,7 @@ # intern_names = 1 # Intern global variable and attribute names -cache_builtins = 1 # Perform lookups on builtin names only once +cache_builtins = 0 # Perform lookups on builtin names only once embed_pos_in_docstring = 0 gcc_branch_hints = 1 @@ -18,4 +18,4 @@ incref_local_binop = 0 # Decref global variables in this module on exit for garbage collection. # 0: None, 1+: interned objects, 2+: cdef globals, 3+: types objects -generate_cleanup_code = 1 +generate_cleanup_code = 0 -- 2.26.2