mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656)
This commit is contained in:
parent
2b496e7929
commit
b854557b49
6 changed files with 6726 additions and 6711 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue