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