New submission from Xavier de Gaye:

When tracing, the frame of a suspended generator should not have an f_trace 
function as there is no way to delete the frame f_trace attribute in that case 
even though
tracing may have been disabled.

The patch relies on the fact that whenever the generator is resumed, a 'call' 
tracing event is issued and the generator's frame f_trace is set again.
As expected, frames, including generators' frames, have their f_trace attribute 
cleared on the 'return' tracing event that is issued when the frame goes out of 
scope
or when the system's trace function has been removed.

----------
components: Interpreter Core
files: generator_f_trace.patch
keywords: patch
messages: 224887
nosy: xdegaye
priority: normal
severity: normal
status: open
title: the frame of a suspended generator should not have a local trace function
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file36277/generator_f_trace.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22149>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to