Skip to content

Commit 8c7e583

Browse files
committed
calls where a lambda value is the fn name
See rocky/python-uncompyle6#350
1 parent 47b5587 commit 8c7e583

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

admin-tools/pyenv-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
55
echo "This script should be *sourced* rather than run directly through bash"
66
exit 1
77
fi
8-
export PYVERSIONS='3.7.8 3.8.5'
8+
export PYVERSIONS='3.7.10 3.8.10'

decompyle3/semantics/customize37.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,9 @@ def n_call(node):
583583
and opname == "CALL_FUNCTION_1"
584584
or not re.match(r"\d", opname[-1])
585585
):
586+
template = "(%c)(%p)" if node[0][0] == "mklambda" else "%c(%p)"
586587
self.template_engine(
587-
("%c(%p)", (0, "expr"), (1, PRECEDENCE["yield"] - 1)), node
588+
(template, (0, "expr"), (1, PRECEDENCE["yield"] - 1)), node
588589
)
589590
self.prec = p
590591
self.prune()
225 Bytes
Binary file not shown.
233 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# From https://github.com/rocky/python-uncompyle6/issues/350
2+
# This is RUNNABLE!
3+
a = (lambda x: x)(abs)
4+
assert a(-3) == 3

0 commit comments

Comments
 (0)