Fixed 3.6 Loops y0 y1 y2 test cases

This commit is contained in:
Xinlong Hu
2025-07-17 11:02:45 -05:00
parent 22b512b2d2
commit bafc3b7878
2 changed files with 15 additions and 4 deletions
+12 -2
View File
@@ -380,7 +380,6 @@ def x1_continue_with_else_nofallthru():
print("Else clause still executes after continue")
print("end")
# 3.6 Naive break detection, an unexpected buffer POP_BLOCK to end
# 3.9/3.11 Naive break detection, break statement is further up
def y0_break_in_try_except():
for i in range(5):
@@ -391,7 +390,6 @@ def y0_break_in_try_except():
except:
print("Exception occurred")
# 3.6 Naive break detection, an unexpected buffer POP_BLOCK to end
# 3.9/3.11 Naive break detection, break statement is further up
def y1_break_in_try_except_nofallthru():
for i in range(5):
@@ -403,6 +401,18 @@ def y1_break_in_try_except_nofallthru():
print("Exception occurred")
print("end")
# 3.9/3.11 Naive break detection, break statement is further up
def y2_return_in_try_except_nofallthru():
for i in range(5):
try:
if i == 3:
print(f"Value: {i}")
else:
break
except:
print("Exception occurred")
print("end")
# 3.6/3.9/3.11 No continue detection
def z0_continue_in_try_except():
for i in range(5):