aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-01-05 12:04:10 +0000
committerGitHub <noreply@github.com>2021-01-05 12:04:10 +0000
commitee9f98d9f4b881ee15868a836a2b99271df1bc0e (patch)
tree5f5a6b4cc99c86d7ee99cf0c8287cf601abd99a7 /Include
parentbpo-32631: IDLE: Enable zzdummy example extension module (GH-14491) (diff)
downloadcpython-ee9f98d9f4b881ee15868a836a2b99271df1bc0e.tar.gz
cpython-ee9f98d9f4b881ee15868a836a2b99271df1bc0e.tar.bz2
cpython-ee9f98d9f4b881ee15868a836a2b99271df1bc0e.zip
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
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/frameobject.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h
index 63240b5b6d5..28170615a04 100644
--- a/Include/cpython/frameobject.h
+++ b/Include/cpython/frameobject.h
@@ -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 */