summaryrefslogtreecommitdiff
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-08-09 10:54:48 +0100
committerGitHub <noreply@github.com>2021-08-09 10:54:48 +0100
commit762ef85f441cdec002cb4e812b9e77ae5033e571 (patch)
tree4c3b61ca54e9fb7c79cfac2c8731e7d5a5bec9c1 /Lib/test/test_sys_settrace.py
parent7d6a0fe5b8001b63d452af5364422e40d06ac755 (diff)
downloadcpython-git-762ef85f441cdec002cb4e812b9e77ae5033e571.tar.gz
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) (#27673)
(cherry picked from commit b854557b49083d8625a433eb36aacb0c87d67c52)
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 213c88b404..4f13bbd6bf 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -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():