mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 05:00:07 +00:00
commit
dd8f22e698
BIN
test/bytecode_2.6_run/01_lambda_call.pyc
Normal file
BIN
test/bytecode_2.6_run/01_lambda_call.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7_run/01_lambda_call.pyc
Normal file
BIN
test/bytecode_2.7_run/01_lambda_call.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.7_run/01_lambda_call.pyc
Normal file
BIN
test/bytecode_3.7_run/01_lambda_call.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.8_run/01_lambda_call.pyc
Normal file
BIN
test/bytecode_3.8_run/01_lambda_call.pyc
Normal file
Binary file not shown.
4
test/simple_source/bug22/01_lambda_call.py
Normal file
4
test/simple_source/bug22/01_lambda_call.py
Normal file
@ -0,0 +1,4 @@
|
||||
# From https://github.com/rocky/python-uncompyle6/issues/350
|
||||
# This is RUNNABLE!
|
||||
a = (lambda x: x)(abs)
|
||||
assert a(-3) == 3
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2019-2020 by Rocky Bernstein
|
||||
# Copyright (c) 2019-2021 by Rocky Bernstein
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -275,11 +275,16 @@ def customize_for_version37(self, version):
|
||||
and opname == "CALL_FUNCTION_1"
|
||||
or not re.match(r"\d", opname[-1])
|
||||
):
|
||||
if node[0][0] == "_mklambda":
|
||||
template = "(%c)(%p)"
|
||||
else:
|
||||
template = "%c(%p)"
|
||||
self.template_engine(
|
||||
("%c(%p)",
|
||||
(template,
|
||||
(0, "expr"),
|
||||
(1, PRECEDENCE["yield"]-1)),
|
||||
node)
|
||||
node
|
||||
)
|
||||
self.prec = p
|
||||
self.prune()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user