mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
account for python2/3 with six in ThriftSerializationContext pythonToThriftMap
This commit is contained in:
parent
48d133a136
commit
486a1ca820
1 changed files with 4 additions and 2 deletions
|
@ -255,10 +255,12 @@ class ThriftSerializationContext(object):
|
|||
pyt = type(obj)
|
||||
if pyt in pythonToThriftMap:
|
||||
return pythonToThriftMap[pyt]
|
||||
elif pyt.__module__[:DS_LEN - 1] == 'dynamicserialize.dstypes':
|
||||
elif pyt.__module__[:DS_LEN - 1] == ('dynamicserialize.dstypes'):
|
||||
if six.PY2:
|
||||
return pythonToThriftMap[types.InstanceType]
|
||||
return pythonToThriftMap[object]
|
||||
raise dynamicserialize.SerializationException(
|
||||
"Don't know how to serialize object of type: " + str(pyt))
|
||||
"Don't know how to serialize object of type: " + str(pyt))
|
||||
|
||||
def serializeMessage(self, obj):
|
||||
tt = self._lookupType(obj)
|
||||
|
|
Loading…
Add table
Reference in a new issue