bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) (#27673)

(cherry picked from commit b854557b49)
This commit is contained in:
Mark Shannon 2021-08-09 10:54:48 +01:00 committed by GitHub
parent 7d6a0fe5b8
commit 762ef85f44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 3907 additions and 3873 deletions

View file

@ -894,6 +894,29 @@ class TraceTestCase(unittest.TestCase):
(4, 'line'),
(4, 'return')])
def test_nested_ifs_with_and(self):
def func():
if A:
if B:
if C:
if D:
return False
else:
return False
elif E and F:
return True
A = B = True
C = False
self.run_and_compare(func,
[(0, 'call'),
(1, 'line'),
(2, 'line'),
(3, 'line'),
(3, 'return')])
def test_nested_try_if(self):
def func():