toon: net string could either be str or bytes
This commit is contained in:
parent
28da462e52
commit
616a9b9f6c
1 changed files with 4 additions and 1 deletions
|
@ -2519,7 +2519,10 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def makeFromNetString(self, string):
|
def makeFromNetString(self, string):
|
||||||
|
if type(string) == bytes:
|
||||||
dg = PyDatagram(string)
|
dg = PyDatagram(string)
|
||||||
|
else:
|
||||||
|
dg = PyDatagram(string.encode('utf-8'))
|
||||||
dgi = PyDatagramIterator(dg)
|
dgi = PyDatagramIterator(dg)
|
||||||
self.type = dgi.getFixedString(1)
|
self.type = dgi.getFixedString(1)
|
||||||
if self.type == 't':
|
if self.type == 't':
|
||||||
|
|
Loading…
Reference in a new issue