From def9e1676baf531af4b8149eebc710679cfd2baa Mon Sep 17 00:00:00 2001 From: rocky Date: Sun, 4 Mar 2018 19:28:51 -0500 Subject: [PATCH] look for "closure" node from the end... Fix previous commit. Looking from the beginning fails because there are a variable number of default values. From the end though seems fixed. --- uncompyle6/semantics/make_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uncompyle6/semantics/make_function.py b/uncompyle6/semantics/make_function.py index 38c661b1..41f16cdd 100644 --- a/uncompyle6/semantics/make_function.py +++ b/uncompyle6/semantics/make_function.py @@ -504,7 +504,7 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None): # FIXME: there is probably a better way to classify this. if (self.version <= 3.3 and len(node) > 2 and node[lambda_index] != 'LOAD_LAMBDA' and - (node[0].kind.startswith('kwarg') or node[2].kind != 'load_closure')): + (node[0].kind.startswith('kwarg') or node[-4].kind != 'load_closure')): # args are after kwargs; kwargs are bundled as one node defparams = node[1:args_node.attr[0]+1] else: