From 7283842b3a27e79fea11eb597defa7fcc4f05702 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Wed, 30 Mar 2016 18:25:17 +0200 Subject: [PATCH] Make an error message more explicit. Resolving some constant function calls may generate tabs, e.g. llUnescapeURL("%09"). That can't be pasted into a script, and a warning is emitted. The warning text was misleading, making one think that something went wrong when all that happened is that an optimization couldn't be applied. Rewrite the text of the warning to be clearer about what the problem is. --- lslopt/lslfoldconst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 5e460ce..639a5b4 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -945,7 +945,7 @@ class foldconst(object): else: value = fn(*tuple(arg['value'] for arg in child)) if not self.foldtabs and isinstance(value, unicode) and '\t' in value: - warning('Tab in function result and foldtabs option not used.') + warning("Can't optimize call to %s because it would generate a tab character (you can force the optimization with the foldtabs option)." % node['name']) return parent[index] = {'nt':'CONST', 't':node['t'], 'value':value} except lslfuncs.ELSLCantCompute: