# HG changeset patch # User Paul Boddie # Date 1478021022 -3600 # Node ID 4b424c223b8ab3e4f19f4b0d6aeb3730d92bb1de # Parent 989663c465ca65fecfde6132c85949a739a2d8f4 Make sure that the target is set so that the context is also set. Fixed the __invoke call, making sure that the target is defined first. Otherwise, it appears that the arguments may be ill-defined. diff -r 989663c465ca -r 4b424c223b8a translator.py --- a/translator.py Tue Nov 01 13:52:30 2016 +0100 +++ b/translator.py Tue Nov 01 18:23:42 2016 +0100 @@ -932,13 +932,11 @@ # Without a known specific callable, the expression provides the target. - if not target: - stages.append(str(expr)) + stages.append("__tmp_target = %s" % expr) # Any specific callable is then obtained. - else: - stages.append("__tmp_target = %s" % expr) + if target: stages.append(target) # With a known target, the function is obtained directly and called. @@ -950,7 +948,7 @@ # the callable and argument collections. else: - output = "__invoke(\n(\n%s\n),\n%d, %d, %s, %s,\n%d, %s\n)" % ( + output = "(%s, __invoke(\n__tmp_target,\n%d, %d, %s, %s,\n%d, %s\n))" % ( ",\n".join(stages), self.always_callable and 1 or 0, len(kwargs), kwcodestr, kwargstr,