bpo-41670: Remove outdated predict macro invocation. (GH-22026)

Remove PREDICTion of POP_BLOCK from FOR_ITER.
This commit is contained in:
Mark Shannon 2020-09-29 10:09:13 +01:00 committed by GitHub
parent 5b0181d1f6
commit 17b5be0c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -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"""