mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138)
This commit is contained in:
parent
5007a4f23c
commit
a86f7dae0a
5 changed files with 4413 additions and 4339 deletions
|
@ -986,14 +986,29 @@ class TraceTestCase(unittest.TestCase):
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
# This doesn't conform to PEP 626
|
||||
self.run_and_compare(func,
|
||||
[(0, 'call'),
|
||||
(1, 'line'),
|
||||
(2, 'line'),
|
||||
(3, 'line'),
|
||||
(5, 'line'),
|
||||
(5, 'return')])
|
||||
(3, 'return')])
|
||||
|
||||
def test_if_in_if_in_if(self):
|
||||
def func(a=0, p=1, z=1):
|
||||
if p:
|
||||
if a:
|
||||
if z:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
|
||||
self.run_and_compare(func,
|
||||
[(0, 'call'),
|
||||
(1, 'line'),
|
||||
(2, 'line'),
|
||||
(2, 'return')])
|
||||
|
||||
def test_early_exit_with(self):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue