Commit 3e01699c authored by Mark Florisson's avatar Mark Florisson

Analyze fused declaration code in the global scope

parent 804c439c
...@@ -360,7 +360,7 @@ class FusedCFuncDefNode(StatListNode): ...@@ -360,7 +360,7 @@ class FusedCFuncDefNode(StatListNode):
%s %s
break break
else: else:
PyErr_Clear() __pyx_PyErr_Clear()
""" % self.match) """ % self.match)
def _buffer_checks(self, buffer_types, pyx_code, decl_code, env): def _buffer_checks(self, buffer_types, pyx_code, decl_code, env):
...@@ -524,7 +524,7 @@ class FusedCFuncDefNode(StatListNode): ...@@ -524,7 +524,7 @@ class FusedCFuncDefNode(StatListNode):
decl_code.put_chunk( decl_code.put_chunk(
u""" u"""
cdef extern from *: cdef extern from *:
void PyErr_Clear() void __pyx_PyErr_Clear "PyErr_Clear" ()
""") """)
decl_code.indent() decl_code.indent()
...@@ -601,7 +601,8 @@ class FusedCFuncDefNode(StatListNode): ...@@ -601,7 +601,8 @@ class FusedCFuncDefNode(StatListNode):
# print fragment_code # print fragment_code
fragment = TreeFragment.TreeFragment(fragment_code, level='module') fragment = TreeFragment.TreeFragment(fragment_code, level='module')
ast = TreeFragment.SetPosTransform(self.node.pos)(fragment.root) ast = TreeFragment.SetPosTransform(self.node.pos)(fragment.root)
UtilityCode.declare_declarations_in_scope(decl_code.getvalue(), env) UtilityCode.declare_declarations_in_scope(decl_code.getvalue(),
env.global_scope())
ast.scope = env ast.scope = env
ast.analyse_declarations(env) ast.analyse_declarations(env)
py_func = ast.stats[-1] # the DefNode py_func = ast.stats[-1] # the DefNode
......
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