diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_dis.py | 4 | ||||
-rw-r--r-- | Lib/test/test_peepholer.py | 6 | ||||
-rw-r--r-- | Lib/test/test_sys_settrace.py | 4 |
3 files changed, 5 insertions, 9 deletions
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index ac5836d..4533a01 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -360,8 +360,6 @@ dis_tryfinally = """\ 16 CALL_FUNCTION 0 18 POP_TOP 20 RERAISE - 22 LOAD_CONST 0 (None) - 24 RETURN_VALUE """ % (_tryfinally.__code__.co_firstlineno + 1, _tryfinally.__code__.co_firstlineno + 2, _tryfinally.__code__.co_firstlineno + 4, @@ -385,8 +383,6 @@ dis_tryfinallyconst = """\ 16 CALL_FUNCTION 0 18 POP_TOP 20 RERAISE - 22 LOAD_CONST 0 (None) - 24 RETURN_VALUE """ % (_tryfinallyconst.__code__.co_firstlineno + 1, _tryfinallyconst.__code__.co_firstlineno + 2, _tryfinallyconst.__code__.co_firstlineno + 4, 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) diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index 482e918..3f902b1 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -948,7 +948,7 @@ class JumpTestCase(unittest.TestCase): output.append(11) output.append(12) - @jump_test(5, 11, [2, 4], (ValueError, 'unreachable')) + @jump_test(5, 11, [2, 4], (ValueError, 'after')) def test_no_jump_over_return_try_finally_in_finally_block(output): try: output.append(2) @@ -1457,7 +1457,7 @@ class JumpTestCase(unittest.TestCase): async with asynctracecontext(output, 4): output.append(5) - @jump_test(5, 7, [2, 4], (ValueError, "unreachable")) + @jump_test(5, 7, [2, 4], (ValueError, "after")) def test_no_jump_over_return_out_of_finally_block(output): try: output.append(2) |