You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Start folding in 3.5 vararg ops as varargs ops
This commit is contained in:
@@ -131,6 +131,7 @@ class Scanner3(Scanner):
|
|||||||
(self.opc.JUMP_FORWARD,),
|
(self.opc.JUMP_FORWARD,),
|
||||||
(self.opc.JUMP_ABSOLUTE,)]
|
(self.opc.JUMP_ABSOLUTE,)]
|
||||||
|
|
||||||
|
# FIXME: remove this and use instead info from xdis.
|
||||||
# Opcodes that take a variable number of arguments
|
# Opcodes that take a variable number of arguments
|
||||||
# (expr's)
|
# (expr's)
|
||||||
varargs_ops = set([
|
varargs_ops = set([
|
||||||
@@ -141,11 +142,14 @@ class Scanner3(Scanner):
|
|||||||
|
|
||||||
if is_pypy:
|
if is_pypy:
|
||||||
varargs_ops.add(self.opc.CALL_METHOD)
|
varargs_ops.add(self.opc.CALL_METHOD)
|
||||||
if self.version >= 3.6:
|
if self.version >= 3.5:
|
||||||
varargs_ops.add(self.opc.BUILD_CONST_KEY_MAP)
|
varargs_ops |= set([self.opc.BUILD_SET_UNPACK,
|
||||||
# Below is in bit order, "default = bit 0, closure = bit 3
|
self.opc.BUILD_TUPLE_UNPACK])
|
||||||
self.MAKE_FUNCTION_FLAGS = tuple("""
|
if self.version >= 3.6:
|
||||||
default keyword-only annotation closure""".split())
|
varargs_ops.add(self.opc.BUILD_CONST_KEY_MAP)
|
||||||
|
# Below is in bit order, "default = bit 0, closure = bit 3
|
||||||
|
self.MAKE_FUNCTION_FLAGS = tuple("""
|
||||||
|
default keyword-only annotation closure""".split())
|
||||||
|
|
||||||
self.varargs_ops = frozenset(varargs_ops)
|
self.varargs_ops = frozenset(varargs_ops)
|
||||||
# FIXME: remove the above in favor of:
|
# FIXME: remove the above in favor of:
|
||||||
|
Reference in New Issue
Block a user