Fix llList2CSV with -nan in vector and quaternion (with test case).

This commit is contained in:
Sei Lisa 2015-09-09 18:14:27 +02:00
parent 2044f888d4
commit 2d72b8e198
2 changed files with 2 additions and 1 deletions

View file

@ -986,7 +986,7 @@ def llList2CSV(lst):
else:
ret.append(u'%.6f' % elem)
elif type(elem) in (Vector, Quaternion):
ret.append(u'<' + u', '.join(list(u'%.6f' % x for x in elem)) + u'>')
ret.append(u'<' + llList2CSV(list(elem)) + u'>')
else:
ret.append(InternalTypecast(elem, unicode, InList=True, f32=True))
ret = u', '.join(ret)

View file

@ -835,6 +835,7 @@ def do_tests():
test('llList2CSV([llSqrt(F32(-1))])', u'-nan')
test('llList2CSV([llPow(-1.0,F32(1.3))])', u'-nan')
test('llList2CSV([llPow(nan,F32(1.3))])', u'nan')
test('llList2CSV([Vector((-nan,nan,-inf))])', u'<-nan, nan, -inf>')
testXB64S("", "", "")
testXB64S(u"Hello, World!", u"", u"Hello, World!")