Message206735
Section 3.2 of 'The Python Language Reference' states:
f_trace, if not None, is a function called at the start of each source code line
Run the attached tracer.py and see that although f_trace is None in both cases when 'cmd' is either
'delete' or 'set', the second case raises a TypeError exception:
$ python tracer.py
f_trace: None
delete start
delete done
f_trace: None
set start
Traceback (most recent call last):
File "tracer.py", line 19, in <module>
foo('set')
File "tracer.py", line 15, in foo
print(cmd, 'done')
File "tracer.py", line 15, in foo
print(cmd, 'done')
TypeError: 'NoneType' object is not callable
Also, the frame.f_lineno may be wrong in a traceback when f_trace is set to None because
PyFrame_GetLineNumber() does not handle this case.
The attached patch fixes this issue.
The patch also fixes issue 11992 and issue 20040.
The patch also fixes the dispatch_call() method of Bdb in the bdb module when the frame is a
generator and the previous command is next, until or return.
The patch also provides a backward compatible solution to the performance enhancement described in
issue 16672. |
|
Date |
User |
Action |
Args |
2013-12-21 14:01:27 | xdegaye | set | recipients:
+ xdegaye |
2013-12-21 14:01:27 | xdegaye | set | messageid: <1387634487.03.0.628100767515.issue20041@psf.upfronthosting.co.za> |
2013-12-21 14:01:27 | xdegaye | link | issue20041 messages |
2013-12-21 14:01:26 | xdegaye | create | |
|