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,6 +50,9 @@ class PyGeometryData(IGeometryData, PyData.PyData):
def getNumber(self, param): def getNumber(self, param):
t = self.getType(param) t = self.getType(param)
if six.PY2:
value = self.__dataMap[param][0]
else:
value = self.__dataMap[param.encode('utf-8')][0] 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)

View file

@ -124,6 +124,9 @@ 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:
if six.PY2:
locData = locSpecificData[locationName]
else:
locData = locSpecificData[locationName.encode('utf-8')] locData = locSpecificData[locationName.encode('utf-8')]
else: else:
locData = locSpecificData[locationName] locData = locSpecificData[locationName]