Closed gak closed 15 years ago
The callgraphs I generated looked wrong. It turns out that the tracer function needs to return a tracer to be used in each local scope! (See http://www.python.org/doc/2.3.4/lib/debugger-hooks.html#debugger-hooks)
I added a line to tracer, to return itself. That seemed to work:
{{{ def tracer(frame, event, arg): ................ if event == 'return': if pr: print 'return' if call_stack: call_stack.pop(-1) return tracer #new
}}}
Author: mig000 yepp, same problem with the same solution
Author: gak
The callgraphs I generated looked wrong. It turns out that the tracer function needs to return a tracer to be used in each local scope! (See http://www.python.org/doc/2.3.4/lib/debugger-hooks.html#debugger-hooks)
I added a line to tracer, to return itself. That seemed to work:
{{{ def tracer(frame, event, arg): ................ if event == 'return': if pr: print 'return' if call_stack: call_stack.pop(-1) return tracer #new
}}}