From 050077e97a78008a2264e5497871cb06c00e948a Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 29 Nov 2017 22:16:53 +0100 Subject: fix #111 --- mastodon/Mastodon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mastodon') 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: # See if the returned dict is an error dict even though status is 200 if isinstance(response, dict) and 'error' in response: - raise MastodonAPIError("Mastodon API returned error: " + str(response['error'])) + if not isinstance(response['error'], six.string_types): + response['error'] = six.text_type(response['error']) + raise MastodonAPIError("Mastodon API returned error: " + response['error']) # Parse link headers if isinstance(response, list) and \ -- cgit v1.2.3