Commit 0da972de authored by Stefan Behnel's avatar Stefan Behnel

Fix error handling when importing NumPy for Pythran modules.

parent a4e9888c
......@@ -2314,7 +2314,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("#endif")
code.putln("/*--- Library function declarations ---*/")
env.generate_library_function_declarations(code)
if env.directives['np_pythran']:
code.put_error_goto_if_neg(self.pos, "_import_array()")
code.putln("/*--- Threads initialization code ---*/")
code.putln("#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS")
......
......@@ -901,10 +901,6 @@ class Scope(object):
def use_entry_utility_code(self, entry):
self.global_scope().use_entry_utility_code(entry)
def generate_library_function_declarations(self, code):
# Generate extern decls for C library funcs used.
pass
def defines_any(self, names):
# Test whether any of the given names are defined in this scope.
for name in names:
......@@ -1240,10 +1236,6 @@ class ModuleScope(Scope):
scope = scope.find_submodule(submodule)
return scope
def generate_library_function_declarations(self, code):
if self.directives['np_pythran']:
code.putln("import_array();")
def lookup_submodule(self, name):
# Return scope for submodule of this module, or None.
if '.' in name:
......
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