aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodl <[email protected]>2017-11-29 22:16:53 +0100
committercodl <[email protected]>2017-11-29 22:16:53 +0100
commit050077e97a78008a2264e5497871cb06c00e948a (patch)
tree039ffad39fe257be6b728a61dcff4febf49ca445 /mastodon
parent4d99e9316ea02ded025eee99fb963290218e52d2 (diff)
downloadmastodon.py-050077e97a78008a2264e5497871cb06c00e948a.tar.gz
fix #111
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 2f84635..83a8081 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -1227,7 +1227,9 @@ class Mastodon:
1227 1227
1228 # See if the returned dict is an error dict even though status is 200 1228 # See if the returned dict is an error dict even though status is 200
1229 if isinstance(response, dict) and 'error' in response: 1229 if isinstance(response, dict) and 'error' in response:
1230 raise MastodonAPIError("Mastodon API returned error: " + str(response['error'])) 1230 if not isinstance(response['error'], six.string_types):
1231 response['error'] = six.text_type(response['error'])
1232 raise MastodonAPIError("Mastodon API returned error: " + response['error'])
1231 1233
1232 # Parse link headers 1234 # Parse link headers
1233 if isinstance(response, list) and \ 1235 if isinstance(response, list) and \
Powered by cgit v1.2.3 (git 2.41.0)