Commit f8e75a14 authored by Stefan Behnel's avatar Stefan Behnel

error handling code was missing

parent 94292508
......@@ -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);")
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment