8000 [3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers by markshannon · Pull Request #26061 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers #26061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for linenumber of return in nested try statements.
  • Loading branch information
markshannon committed May 12, 2021
commit b89dd60f5f8bdafaddfd5ac0f7eeb23f8c0fe058
20 changes: 20 additions & 0 deletions Lib/test/test_sys_settrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,26 @@ class A:
(3, 'return'),
(1, 'return')])

def test_try_in_try(self):
def func():
try:
try:
pass
except Exception as ex:
pass
except Exception:
pass

# This doesn't conform to PEP 626
self.run_and_compare(func,
[(0, 'call'),
(1, 'line'),
(2, 'line'),
(3, 'line'),
(5, 'line'),
(5, 'return')])


class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""

Expand Down
0