mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
gh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)
This commit is contained in:
parent
994051e086
commit
f474391b26
3 changed files with 18 additions and 2 deletions
|
@ -479,6 +479,19 @@ class TestSpecifics(unittest.TestCase):
|
|||
x = 2
|
||||
"""), '<eval>', 'exec')
|
||||
|
||||
def test_try_except_in_while_with_chained_condition_compiles(self):
|
||||
# see gh-124871
|
||||
compile(textwrap.dedent("""
|
||||
name_1, name_2, name_3 = 1, 2, 3
|
||||
while name_3 <= name_2 > name_1:
|
||||
try:
|
||||
raise
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
pass
|
||||
"""), '<eval>', 'exec')
|
||||
|
||||
def test_compile_invalid_namedexpr(self):
|
||||
# gh-109351
|
||||
m = ast.Module(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue