[3.12] gh-109627: duplicated small exit blocks need to be assigned jump target labels (#109630) (#109632)

gh-109627: duplicated smalll exit blocks need to be assigned jump target labels (#109630)

(cherry picked from commit 9ccf0545ef)
This commit is contained in:
Irit Katriel 2023-09-22 14:27:29 +01:00 committed by GitHub
parent 92a347997f
commit 107e14820a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 6 deletions

View file

@ -1216,6 +1216,15 @@ class TestSpecifics(unittest.TestCase):
return a
self.assertEqual(f("x", "y", "z"), "y")
def test_duplicated_small_exit_block(self):
# See gh-109627
def f():
while element and something:
try:
return something
except:
pass
@requires_debug_ranges()
class TestSourcePositions(unittest.TestCase):