error handling code was missing
authorStefan Behnel <scoder@users.berlios.de>
Sat, 27 Oct 2007 12:40:39 +0000 (14:40 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 27 Oct 2007 12:40:39 +0000 (14:40 +0200)
Cython/Compiler/ModuleNode.py
Cython/Compiler/Options.py

index 74708b2439bd53ee512e68ac9e6135daa9476a15..7fd8ce83badaebc4cfc5b27b62cc60357dbb90cb 100644 (file)
@@ -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);")
index 8c190978087a0e2556e1ccab9ced39190d91ae64..b1f744dc0cf8f2dbbfca3dd10cf7480b39a04e7c 100644 (file)
@@ -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