Skip to content

bpo-42823: Fix frame lineno when frame.f_trace is set#24099

Merged
markshannon merged 6 commits into
python:masterfrom
markshannon:fix-frame-lineno
Jan 5, 2021
Merged

bpo-42823: Fix frame lineno when frame.f_trace is set#24099
markshannon merged 6 commits into
python:masterfrom
markshannon:fix-frame-lineno

Conversation

@markshannon

@markshannon markshannon commented Jan 4, 2021

Copy link
Copy Markdown
Member

Don't rely on f_trace to indicate whether f_lineno is valid.
Also includes a compiler fix, eliminating empty blocks when fixing up line numbers for exit blocks.

https://bugs.python.org/issue42823

@markshannon markshannon closed this Jan 5, 2021
@markshannon markshannon reopened this Jan 5, 2021
@markshannon
markshannon merged commit ee9f98d into python:master Jan 5, 2021
@markshannon
markshannon deleted the fix-frame-lineno branch January 5, 2021 12:04
@nedbat

nedbat commented Jan 6, 2021

Copy link
Copy Markdown
Member

This has caused a regression for C-implemented trace functions. See the bpo for details.

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants