summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-09-29 09:09:13 (GMT)
committerGitHub <noreply@github.com>2020-09-29 09:09:13 (GMT)
commit17b5be0c0a3f74141014e06a660f1b5ddb002fec (patch)
treedbab380ec65937f6957064856eb5f33d77ca56aa /Lib/test/test_sys_settrace.py
parent5b0181d1f6474c2cb9b80bdaf3bc56a78bf5fbe7 (diff)
downloadcpython-17b5be0c0a3f74141014e06a660f1b5ddb002fec.zip
cpython-17b5be0c0a3f74141014e06a660f1b5ddb002fec.tar.gz
cpython-17b5be0c0a3f74141014e06a660f1b5ddb002fec.tar.bz2
bpo-41670: Remove outdated predict macro invocation. (GH-22026)
Remove PREDICTion of POP_BLOCK from FOR_ITER.
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 3f902b1..dd4418d 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -602,6 +602,23 @@ class TraceTestCase(unittest.TestCase):
self.compare_events(doit_async.__code__.co_firstlineno,
tracer.events, events)
+ def test_loop_in_try_except(self):
+ # https://bugs.python.org/issue41670
+
+ def func():
+ try:
+ for i in []: pass
+ return 1
+ except:
+ return 2
+
+ self.run_and_compare(func,
+ [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (3, 'return')])
+
class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""