Small 3.7 steps

This commit is contained in:
rocky
2018-04-13 07:26:32 -04:00
parent 7237658f1f
commit 1890aad660
11 changed files with 18 additions and 4 deletions

View File

@@ -140,7 +140,7 @@ class Scanner3(Scanner):
self.opc.BUILD_MAP, self.opc.UNPACK_SEQUENCE,
self.opc.RAISE_VARARGS])
if is_pypy:
if is_pypy or self.version >= 3.7:
varargs_ops.add(self.opc.CALL_METHOD)
if self.version >= 3.5:
varargs_ops |= set([self.opc.BUILD_SET_UNPACK,
@@ -179,7 +179,7 @@ class Scanner3(Scanner):
bytecode = self.build_instructions(co)
# show_asm = 'after'
# show_asm = 'both'
if show_asm in ('both', 'before'):
for instr in bytecode.get_instructions(co):
print(instr.disassemble())
@@ -347,9 +347,9 @@ class Scanner3(Scanner):
else:
opname = '%s_%d' % (opname, pos_args)
elif self.is_pypy and opname in ('CALL_METHOD', 'JUMP_IF_NOT_DEBUG'):
elif self.is_pypy and opname == 'JUMP_IF_NOT_DEBUG':
# The value in the dict is in special cases in semantic actions, such
# as CALL_FUNCTION. The value is not used in these cases, so we put
# as JUMP_IF_NOT_DEBUG. The value is not used in these cases, so we put
# in arbitrary value 0.
customize[opname] = 0
elif opname == 'UNPACK_EX':