Skip to content

Commit 21451ac

Browse files
Tests from original commit are added
1 parent b240ff5 commit 21451ac

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,27 @@ def testfunc(n):
19721972
assert ex is not None
19731973
"""))
19741974

1975+
def test_next_instr_for_exception_handler_set(self):
1976+
# gh-140104: We just want the exception to be caught properly.
1977+
def f():
1978+
for i in range(TIER2_THRESHOLD + 3):
1979+
try:
1980+
undefined_variable(i)
1981+
except Exception:
1982+
pass
1983+
1984+
f()
1985+
1986+
def test_next_instr_for_exception_handler_set_lasts_instr(self):
1987+
# gh-140104: We just want the exception to be caught properly.
1988+
def f():
1989+
a_list = []
1990+
for _ in range(TIER2_THRESHOLD + 3):
1991+
try:
1992+
a_list[""] = 0
1993+
except Exception:
1994+
pass
1995+
19751996

19761997
def global_identity(x):
19771998
return x

0 commit comments

Comments
 (0)