mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
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:
parent
7d6a0fe5b8
commit
762ef85f44
6 changed files with 3907 additions and 3873 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