mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-41670: Remove outdated predict macro invocation. (GH-22026)
Remove PREDICTion of POP_BLOCK from FOR_ITER.
This commit is contained in:
parent
5b0181d1f6
commit
17b5be0c0a
3 changed files with 21 additions and 2 deletions
|
@ -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"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue