1.1 --- a/translator.py Sun Nov 14 00:37:32 2021 +0100
1.2 +++ b/translator.py Sun Nov 14 00:42:49 2021 +0100
1.3 @@ -1324,6 +1324,13 @@
1.4 for i, arg in enumerate(n.args):
1.5 argexpr = self.process_structure_node(arg)
1.6
1.7 + # Obtain an appropriate argument representation. This prevents
1.8 + # copyable values from being mutable, but care must be taken to
1.9 + # prevent special internal attribute values represented using
1.10 + # attributes from being modified.
1.11 +
1.12 + argrepr = argexpr.as_arg()
1.13 +
1.14 # Store a keyword argument, either in the argument list or
1.15 # in a separate keyword argument list for subsequent lookup.
1.16
1.17 @@ -1338,12 +1345,12 @@
1.18 except ValueError:
1.19 raise TranslateError("Argument %s is not recognised." % arg.name,
1.20 self.get_namespace_path(), n)
1.21 - args[argnum + reserved_args] = str(argexpr)
1.22 + args[argnum + reserved_args] = argrepr
1.23
1.24 # Otherwise, store the details in a separate collection.
1.25
1.26 else:
1.27 - kwargs.append(str(argexpr))
1.28 + kwargs.append(argrepr)
1.29 kwcodes.append("{%s, %s}" % (
1.30 encode_ppos(arg.name), encode_pcode(arg.name)))
1.31
1.32 @@ -1352,7 +1359,7 @@
1.33
1.34 else:
1.35 try:
1.36 - args[i + reserved_args] = str(argexpr)
1.37 + args[i + reserved_args] = argrepr
1.38 except IndexError:
1.39 raise TranslateError("Too many arguments specified.",
1.40 self.get_namespace_path(), n)