[issue20041] TypeError when f_trace is None and tracing.

Xavier de Gaye report at bugs.python.org
Fri Jun 3 16:15:45 EDT 2016


Xavier de Gaye added the comment:

On a 'call' trace event, the bdb dispatch_call() function returns None when there is nothing to trace in this function (no breakpoints). With the changes made by the patch in ceval.c, the costly maybe_call_line_trace() function is not called on each line in this case since f->f_trace is Py_None. This provides the performance enhancements described in issue 16672 without breaking the _hotshot extension module or other extension modules using PyEval_SetTrace().

I agree that the code would be much simpler when f->f_trace is set to NULL by the frame_settrace() setter or trace_trampoline() when it is Py_None. The performance gain described above by using Py_None may not be worth the complexity.

Thanks for looking into this Serhiy.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20041>
_______________________________________


More information about the Python-bugs-list mailing list