summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_peepholer.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-07-30 09:03:00 (GMT)
committerGitHub <noreply@github.com>2020-07-30 09:03:00 (GMT)
commit6e8128f02e1d36e38e5866f9dc36e051caa47bc9 (patch)
tree69cb790e96057a35333a9a2de94934d9ab3aab9d /Lib/test/test_peepholer.py
parentba18c0b13ba3c08077ea3db6658328523823a33f (diff)
downloadcpython-6e8128f02e1d36e38e5866f9dc36e051caa47bc9.zip
cpython-6e8128f02e1d36e38e5866f9dc36e051caa47bc9.tar.gz
cpython-6e8128f02e1d36e38e5866f9dc36e051caa47bc9.tar.bz2
bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)
* Move 'peephole' optimizations into compile.c and perform them directly on the CFG.
Diffstat (limited to 'Lib/test/test_peepholer.py')
-rw-r--r--Lib/test/test_peepholer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index 7913e91..65047ca 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -416,9 +416,9 @@ class TestTranforms(BytecodeTestCase):
if cond1: return 4
self.assertNotInBytecode(f, 'JUMP_FORWARD')
# There should be one jump for the while loop.
- returns = [instr for instr in dis.get_instructions(f)
- if instr.opname == 'JUMP_ABSOLUTE']
- self.assertEqual(len(returns), 1)
+ jumps = [instr for instr in dis.get_instructions(f)
+ if 'JUMP' in instr.opname]
+ self.assertEqual(len(jumps), 1)
returns = [instr for instr in dis.get_instructions(f)
if instr.opname == 'RETURN_VALUE']
self.assertLessEqual(len(returns), 2)