mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
UnicodeType added to thrift serialization to support h5py 2.0+
This commit is contained in:
parent
df44b1b32d
commit
4881a52ac6
1 changed files with 3 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
|||
# 06/09/10 njensen Initial Creation.
|
||||
# 06/12/13 #2099 dgilling Implement readObject() and
|
||||
# writeObject().
|
||||
# 03/18/16 mjames@ucar Add types.UnicodeType
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -65,6 +66,7 @@ buildObjMap(dstypes)
|
|||
|
||||
pythonToThriftMap = {
|
||||
types.StringType: TType.STRING,
|
||||
types.UnicodeType: TType.STRING,
|
||||
types.IntType: TType.I32,
|
||||
types.LongType: TType.I64,
|
||||
types.ListType: TType.LIST,
|
||||
|
@ -237,7 +239,7 @@ class ThriftSerializationContext(object):
|
|||
return result
|
||||
|
||||
def _lookupType(self, obj):
|
||||
pyt = type(obj)
|
||||
pyt = type(obj) # <type 'unicode'> for h5py 2.0+
|
||||
if pythonToThriftMap.has_key(pyt):
|
||||
return pythonToThriftMap[pyt]
|
||||
elif pyt.__module__.startswith('dynamicserialize.dstypes'):
|
||||
|
|
Loading…
Add table
Reference in a new issue