mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-42823: Fix frame lineno when frame.f_trace is set (GH-24099)
* Add test for frame.f_lineno with/without tracing. * Make sure that frame.f_lineno is correct regardless of whether frame.f_trace is set. * Update importlib * Add NEWS
This commit is contained in:
parent
e40e2a2cc9
commit
ee9f98d9f4
8 changed files with 1182 additions and 1159 deletions
|
|
@ -42,12 +42,7 @@ struct _frame {
|
|||
PyObject *f_gen;
|
||||
|
||||
int f_lasti; /* Last instruction if called */
|
||||
/* Call PyFrame_GetLineNumber() instead of reading this field
|
||||
directly. As of 2.3 f_lineno is only valid when tracing is
|
||||
active (i.e. when f_trace is set). At other times we use
|
||||
PyCode_Addr2Line to calculate the line from the current
|
||||
bytecode index. */
|
||||
int f_lineno; /* Current line number */
|
||||
int f_lineno; /* Current line number. Only valid if non-zero */
|
||||
int f_iblock; /* index in f_blockstack */
|
||||
PyFrameState f_state; /* What state the frame is in */
|
||||
PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue