diff options
author | Mark Shannon <mark@hotpy.org> | 2020-12-15 11:07:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 11:07:50 (GMT) |
commit | 8473cf89bdbf2cb292b39c972db540504669b9cd (patch) | |
tree | 68e19e5056b75e3e86d8bc13b7ac6c214fb83ea6 /Lib/test/test_peepholer.py | |
parent | 6f79e60b66dacefca147bdaa80eb37f936a72991 (diff) | |
download | cpython-8473cf89bdbf2cb292b39c972db540504669b9cd.zip cpython-8473cf89bdbf2cb292b39c972db540504669b9cd.tar.gz cpython-8473cf89bdbf2cb292b39c972db540504669b9cd.tar.bz2 |
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. (GH-23743)
Diffstat (limited to 'Lib/test/test_peepholer.py')
-rw-r--r-- | Lib/test/test_peepholer.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 92a82cc..4034154 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -409,21 +409,6 @@ class TestTranforms(BytecodeTestCase): self.assertLessEqual(len(returns), 6) self.check_lnotab(f) - def test_elim_jump_after_return2(self): - # Eliminate dead code: jumps immediately after returns can't be reached - def f(cond1, cond2): - while 1: - if cond1: return 4 - self.assertNotInBytecode(f, 'JUMP_FORWARD') - # There should be one jump for the while loop. - 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) - self.check_lnotab(f) - def test_make_function_doesnt_bail(self): def f(): def g()->1+1: |