Skip to content

Commit bd52942

Browse files
committed
properly convert bytestring ascii value
1 parent 477e711 commit bd52942

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Hologram/HologramCloud.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ def popReceivedSMS(self):
186186
def __parse_hologram_json_result(self, result):
187187
try:
188188
resultList = json.loads(result)
189-
resultList[0] = int(resultList[0])
189+
if isinstance(resultList, bytes):
190+
resultList[0] = int(chr(resultList[0]))
191+
else:
192+
resultList[0] = int(resultList[0])
190193
except ValueError:
191194
self.logger.error('Server replied with invalid JSON [%s]', result)
192195
resultList = [ERR_UNKNOWN]

0 commit comments

Comments
 (0)