classification
Title: the frame of a suspended generator should not have a local trace function
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, benjamin.peterson, xdegaye
Priority: normal Keywords: patch

Created on 2014-08-05 20:39 by xdegaye, last changed 2019-03-15 22:20 by BreamoreBoy.

Files
File name Uploaded Description Edit
generator_f_trace.patch xdegaye, 2014-08-05 20:39 review
Messages (2)
msg224887 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2014-08-05 20:39
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.
msg238863 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-03-22 02:06
Can we have a formal patch review please.  I've assumed that if acceptable the patch could also be applied to 3.4 and 2.7.
History
Date User Action Args
2019-03-15 22:20:38BreamoreBoysetnosy: - BreamoreBoy
2015-03-22 02:06:30BreamoreBoysetnosy: + BreamoreBoy

messages: + msg238863
versions: + Python 2.7, Python 3.4
2014-08-06 02:44:55pitrousetnosy: + belopolsky, benjamin.peterson
2014-08-05 20:39:23xdegayecreate