aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-11-30 16:02:29 +0100
committerGitHub <[email protected]>2017-11-30 16:02:29 +0100
commitc6f1196ddc1899e64d60b102e1cfa1c1c1321e77 (patch)
tree107718e14050a9f6e5046157375fe7fae5c5409d /mastodon
parentf52c8f5024f4383fbcc645e54d2cbda5038ebd2c (diff)
parent050077e97a78008a2264e5497871cb06c00e948a (diff)
downloadmastodon.py-c6f1196ddc1899e64d60b102e1cfa1c1c1321e77.tar.gz
Merge pull request #112 from codl/fix-111
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)