toon: net string could either be str or bytes

This commit is contained in:
John Cote 2019-12-30 19:23:15 -05:00
parent 28da462e52
commit 616a9b9f6c

View file

@ -2519,7 +2519,10 @@ class ToonDNA(AvatarDNA.AvatarDNA):
return True
def makeFromNetString(self, string):
dg = PyDatagram(string)
if type(string) == bytes:
dg = PyDatagram(string)
else:
dg = PyDatagram(string.encode('utf-8'))
dgi = PyDatagramIterator(dg)
self.type = dgi.getFixedString(1)
if self.type == 't':