Skip to content

Commit ab4a8c9

Browse files
Address review; add test
1 parent 1e6b2e4 commit ab4a8c9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,6 +2648,19 @@ def f():
26482648

26492649
f()
26502650

2651+
def test_next_instr_for_exception_handler_set_lasts_instr(self):
2652+
# gh-140104: We just want the exception to be caught properly.
2653+
def f():
2654+
a_list = []
2655+
for _ in range(TIER2_THRESHOLD + 3):
2656+
try:
2657+
a_list[""] = 0
2658+
except Exception:
2659+
pass
2660+
2661+
f()
2662+
2663+
26512664

26522665
def global_identity(x):
26532666
return x

0 commit comments

Comments
 (0)