Add Python 3.6 mklambda rule

This commit is contained in:
rocky
2018-03-18 23:37:32 -04:00
parent b9281c79be
commit 94038151f4
3 changed files with 12 additions and 0 deletions

Binary file not shown.

View 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)

View File

@@ -886,6 +886,14 @@ class Python3Parser(PythonParser):
# before.
args_pos, args_kw, annotate_args, closure = token.attr
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' %
('expr ' * stack_count,
'load_closure ' * closure,