You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
3.6 decompilation problems
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -47,3 +47,7 @@ def __init__(self, cnf={}):
|
||||
def Value(self, fn, typecode_or_type, *args, lock=True):
|
||||
return fn(typecode_or_type, *args, lock=lock,
|
||||
ctx=self.get_context())
|
||||
|
||||
# From 3.6.4 heapq.py
|
||||
def merge(*iterables, key=None, reverse=False):
|
||||
return
|
||||
|
@@ -33,7 +33,7 @@ class Python35Parser(Python34Parser):
|
||||
# ...
|
||||
# the end of the if will jump back to the loop and there will be a COME_FROM
|
||||
# after the jump
|
||||
l_stmts ::= lastl_stmt COME_FROM l_stmts
|
||||
l_stmts ::= lastl_stmt come_froms l_stmts
|
||||
|
||||
# Python 3.5+ Await statement
|
||||
expr ::= await_expr
|
||||
|
@@ -49,8 +49,9 @@ class Python36Parser(Python35Parser):
|
||||
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt
|
||||
JUMP_BACK come_froms POP_BLOCK COME_FROM_LOOP
|
||||
|
||||
# This might be valid in < 3.6
|
||||
# A COME_FROM is dropped off because of JUMP-to-JUMP optimization
|
||||
and ::= expr jmp_false expr
|
||||
and ::= expr jmp_false expr jmp_false
|
||||
|
||||
jf_cf ::= JUMP_FORWARD COME_FROM
|
||||
conditional ::= expr jmp_false expr jf_cf expr COME_FROM
|
||||
|
@@ -592,7 +592,10 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
|
||||
params.reverse() # back to correct order
|
||||
|
||||
if code_has_star_arg(code):
|
||||
if self.version > 3.0:
|
||||
if self.version >= 3.6:
|
||||
j = -2 if code_has_star_star_arg(code) else -1
|
||||
params.append('*%s' % code.co_varnames[j])
|
||||
elif self.version > 3.0:
|
||||
params.append('*%s' % code.co_varnames[argc + kw_pairs])
|
||||
else:
|
||||
params.append('*%s' % code.co_varnames[argc])
|
||||
|
Reference in New Issue
Block a user