diff --git a/grafana_client/client.py b/grafana_client/client.py index e4717fe..9ce913b 100644 --- a/grafana_client/client.py +++ b/grafana_client/client.py @@ -142,7 +142,7 @@ def __request_runner(url, json=None, data=None, headers=None): response = r.json() except ValueError: response = r.text - message = response["message"] if type(response) == dict and "message" in response else r.text + message = response["message"] if isinstance(response, dict) and "message" in response else r.text if 500 <= r.status_code < 600: raise GrafanaServerError(