Message206734
The sys.settrace documentation states:
The trace function is invoked (with event set to 'call') whenever a new local scope is entered;
it should return a reference to a local trace function to be used that scope, or None if the scope shouldn’t be traced.
But when tracing a generator, 'line' events may be traced even though tracing has been disabled by
returning None at the 'call' event. Run the attached tracer.py with 0 as argument and see that
tracing does not stop as it should when count is 1:
$ python tracer.py 0
call gen with count 0
line
line
return
call gen with count 1
returning None: the scope shouldn’t be traced
line
return
However, when tracer.py is run with 1 as argument, tracing is (correctly) disabled when count is 1
and 2. This problem is closely related to issue 11992.
The dispatch_call() method of Bdb in the bdb module is broken when the frame is a generator and the
previous command is next, until or return (and when this problem is fixed). |
|
Date |
User |
Action |
Args |
2013-12-21 13:55:53 | xdegaye | set | recipients:
+ xdegaye |
2013-12-21 13:55:53 | xdegaye | set | messageid: <1387634153.88.0.744375474198.issue20040@psf.upfronthosting.co.za> |
2013-12-21 13:55:53 | xdegaye | link | issue20040 messages |
2013-12-21 13:55:52 | xdegaye | create | |
|