gh-130574: renumber RESUME opcode from 149 to 128 (GH-130685)

This commit is contained in:
Tomasz Pytel 2025-03-06 03:59:36 -05:00 committed by GitHub
parent e4a60248b0
commit aeb2327386
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 243 additions and 241 deletions

View file

@ -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()