You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
Add Python 3.6 mklambda rule
This commit is contained in:
BIN
test/bytecode_3.6/05_36lambda.pyc
Normal file
BIN
test/bytecode_3.6/05_36lambda.pyc
Normal file
Binary file not shown.
4
test/simple_source/bug36/05_36lambda.py
Normal file
4
test/simple_source/bug36/05_36lambda.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# From Python 3.6 hmac.py
|
||||||
|
# needed to change mklamba rule
|
||||||
|
def __init__(self, msg = None, digestmod = None):
|
||||||
|
self.digest_cons = lambda d='': digestmod.new(d)
|
@@ -886,6 +886,14 @@ class Python3Parser(PythonParser):
|
|||||||
# before.
|
# before.
|
||||||
args_pos, args_kw, annotate_args, closure = token.attr
|
args_pos, args_kw, annotate_args, closure = token.attr
|
||||||
stack_count = args_pos + args_kw + annotate_args
|
stack_count = args_pos + args_kw + annotate_args
|
||||||
|
if closure:
|
||||||
|
rule = ('mklambda ::= %s%s%s%s' %
|
||||||
|
('expr ' * stack_count,
|
||||||
|
'load_closure ' * closure,
|
||||||
|
'BUILD_TUPLE_1 LOAD_LAMBDA LOAD_CONST ',
|
||||||
|
opname))
|
||||||
|
self.add_unique_rule(rule, opname, token.attr, customize)
|
||||||
|
|
||||||
rule = ('mkfunc ::= %s%s%s%s' %
|
rule = ('mkfunc ::= %s%s%s%s' %
|
||||||
('expr ' * stack_count,
|
('expr ' * stack_count,
|
||||||
'load_closure ' * closure,
|
'load_closure ' * closure,
|
||||||
|
Reference in New Issue
Block a user