mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-130574: renumber RESUME opcode from 149 to 128 (GH-130685)
This commit is contained in:
parent
e4a60248b0
commit
aeb2327386
10 changed files with 243 additions and 241 deletions
|
@ -429,14 +429,14 @@ class CodeTest(unittest.TestCase):
|
|||
def foo():
|
||||
pass
|
||||
|
||||
# assert that opcode 135 is invalid
|
||||
self.assertEqual(opname[135], '<135>')
|
||||
# assert that opcode 127 is invalid
|
||||
self.assertEqual(opname[127], '<127>')
|
||||
|
||||
# change first opcode to 0x87 (=135)
|
||||
# change first opcode to 0x7f (=127)
|
||||
foo.__code__ = foo.__code__.replace(
|
||||
co_code=b'\x87' + foo.__code__.co_code[1:])
|
||||
co_code=b'\x7f' + foo.__code__.co_code[1:])
|
||||
|
||||
msg = "unknown opcode 135"
|
||||
msg = "unknown opcode 127"
|
||||
with self.assertRaisesRegex(SystemError, msg):
|
||||
foo()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue