gh-101632: Add the new RETURN_CONST opcode (#101633)

This commit is contained in:
penguin_wwy 2023-02-08 06:32:21 +08:00 committed by GitHub
parent 0d3d5007b1
commit 753fc8a5d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 186 additions and 154 deletions

View file

@ -1900,7 +1900,7 @@ class ConstantTests(unittest.TestCase):
co = compile(tree, '<string>', 'exec')
consts = []
for instr in dis.get_instructions(co):
if instr.opname == 'LOAD_CONST':
if instr.opname == 'LOAD_CONST' or instr.opname == 'RETURN_CONST':
consts.append(instr.argval)
return consts