mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2024-11-21 06:15:56 -07:00
Fix regression introduced with the latest changes to loadlib
In Python 2, function type names from buiiltins.txt were entered into the tables as Unicode, causing the output module to promote strings to Unicode, and causing trouble further down the line. Entering them as str fixes the issue. Thanks a lot to @PeterStindberg for reporting the issue and providing a script that reproduces it. Fixes #21
This commit is contained in:
parent
642f8e995d
commit
e3c1634724
3 changed files with 19 additions and 2 deletions
|
@ -104,7 +104,7 @@ def LoadLibrary(builtins = None, fndata = None):
|
|||
% (ubuiltins, linenum, argtyp))
|
||||
bad = True
|
||||
break
|
||||
args.append(argtyp)
|
||||
args.append(u2str(argtyp))
|
||||
if bad:
|
||||
continue
|
||||
name = match.group(2)
|
||||
|
@ -123,7 +123,8 @@ def LoadLibrary(builtins = None, fndata = None):
|
|||
u" in %s, overwriting: %s"
|
||||
% (linenum, ubuiltins, name))
|
||||
fn = getattr(lslfuncs, name, None)
|
||||
functions[name] = {'Kind':'f', 'Type':typ, 'uns':True,
|
||||
styp = None if typ is None else u2str(typ)
|
||||
functions[name] = {'Kind':'f', 'Type':styp, 'uns':True,
|
||||
'ParamTypes':args, 'NeedsData':True}
|
||||
if fn is not None:
|
||||
functions[name]['Fn'] = fn
|
||||
|
|
8
unit_tests/regression.suite/issue-21.lsl
Normal file
8
unit_tests/regression.suite/issue-21.lsl
Normal file
|
@ -0,0 +1,8 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llOwnerSay(llList2Key(llGetObjectDetails("", [1]),0));
|
||||
llOwnerSay(llChar(0xA1));
|
||||
}
|
||||
}
|
8
unit_tests/regression.suite/issue-21.out
Normal file
8
unit_tests/regression.suite/issue-21.out
Normal file
|
@ -0,0 +1,8 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llOwnerSay((key)((string)llGetObjectDetails("", (list)1)));
|
||||
llOwnerSay("¡");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue