Json does recognize ints
This commit is contained in:
@@ -65,7 +65,7 @@ class MemcachedConnection(PoolingConnection):
|
|||||||
# try not to load the json every time
|
# try not to load the json every time
|
||||||
if response and response[0] == '{' and ('"status"' in response or '"error"' in response):
|
if response and response[0] == '{' and ('"status"' in response or '"error"' in response):
|
||||||
data = json.loads(response)
|
data = json.loads(response)
|
||||||
if 'status' in data and data['status'].isdigit():
|
if 'status' in data and isinstance(data['status'], int):
|
||||||
status = data['status']
|
status = data['status']
|
||||||
elif 'error' in data:
|
elif 'error' in data:
|
||||||
raise TransportError('N/A', data['error'])
|
raise TransportError('N/A', data['error'])
|
||||||
|
|||||||
Reference in New Issue
Block a user