Commit 76567d05 authored by Mark Florisson's avatar Mark Florisson

Take first Cython step into function before reading variable in test

parents 7d98e4a1 9140d0f9
...@@ -1619,7 +1619,6 @@ class DebugTransform(CythonTransform): ...@@ -1619,7 +1619,6 @@ class DebugTransform(CythonTransform):
self.register_stepinto = True self.register_stepinto = True
self.serialize_modulenode_as_function(node) self.serialize_modulenode_as_function(node)
self.register_stepinto = False self.register_stepinto = False
self.tb.end('Functions') self.tb.end('Functions')
# 2.3 compatibility. Serialize global variables # 2.3 compatibility. Serialize global variables
......
...@@ -51,4 +51,4 @@ closure()() ...@@ -51,4 +51,4 @@ closure()()
closure_without_closing_variables()() closure_without_closing_variables()()
spam() spam()
print "bye!" print "bye!"
\ No newline at end of file
...@@ -356,6 +356,9 @@ class TestClosure(DebugTestCase): ...@@ -356,6 +356,9 @@ class TestClosure(DebugTestCase):
def test_cython_closure(self): def test_cython_closure(self):
self.break_and_run('def inner():') self.break_and_run('def inner():')
# Allow the Cython-generated code to initialize the scope variable
gdb.execute('cy step')
self.assertEqual(str(self.read_var('a')), '1') self.assertEqual(str(self.read_var('a')), '1')
print_result = gdb.execute('cy print a', to_string=True).strip() print_result = gdb.execute('cy print a', to_string=True).strip()
self.assertEqual(print_result, 'a = 1') self.assertEqual(print_result, 'a = 1')
......
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