bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138)

This commit is contained in:
Mark Shannon 2021-07-15 17:46:55 +01:00 committed by GitHub
parent 5007a4f23c
commit a86f7dae0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4413 additions and 4339 deletions

View file

@ -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):