more six python version control for encodings

This commit is contained in:
Michael James 2018-10-09 15:04:11 -06:00
parent e332f3184a
commit 60e470c02c
2 changed files with 8 additions and 2 deletions

View file

@ -50,7 +50,10 @@ class PyGeometryData(IGeometryData, PyData.PyData):
def getNumber(self, param): def getNumber(self, param):
t = self.getType(param) t = self.getType(param)
value = self.__dataMap[param.encode('utf-8')][0] if six.PY2:
value = self.__dataMap[param][0]
else:
value = self.__dataMap[param.encode('utf-8')][0]
if t == 'INT' or t == 'SHORT' or t == 'LONG': if t == 'INT' or t == 'SHORT' or t == 'LONG':
return int(value) return int(value)
elif t == 'FLOAT': elif t == 'FLOAT':

View file

@ -124,7 +124,10 @@ class ThriftClientRouter(object):
for gridDataRecord in response.getGridData(): for gridDataRecord in response.getGridData():
locationName = gridDataRecord.getLocationName() locationName = gridDataRecord.getLocationName()
if locationName is not None: if locationName is not None:
locData = locSpecificData[locationName.encode('utf-8')] if six.PY2:
locData = locSpecificData[locationName]
else:
locData = locSpecificData[locationName.encode('utf-8')]
else: else:
locData = locSpecificData[locationName] locData = locSpecificData[locationName]
if self._lazyLoadGridLatLon: if self._lazyLoadGridLatLon: