1.1 --- a/translator.py Sat Sep 02 01:56:02 2023 +0200
1.2 +++ b/translator.py Sat Sep 02 22:08:53 2023 +0200
1.3 @@ -341,11 +341,15 @@
1.4 else:
1.5 return None
1.6
1.7 - def process_statement_node(self, node):
1.8 + def process_statement_node(self, node, is_lambda=False):
1.9
1.10 "Process the given statement 'node'."
1.11
1.12 self.reset_temp_counters()
1.13 +
1.14 + if is_lambda:
1.15 + self.result_target_name = "__result"
1.16 +
1.17 return CommonModule.process_statement_node(self, node)
1.18
1.19 def process_structure_node(self, n):
1.20 @@ -912,7 +916,9 @@
1.21
1.22 # Produce the body and any additional return statement.
1.23
1.24 - expr = self.process_statement_node(n.code) or \
1.25 + is_lambda = isinstance(n, compiler.ast.Lambda)
1.26 +
1.27 + expr = self.process_statement_node(n.code, is_lambda) or \
1.28 self.in_method() and \
1.29 function_name.rsplit(".", 1)[-1] == "__init__" and \
1.30 TrResolvedNameRef("self", self.importer.function_locals[function_name]["self"]) or \