diff options
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 88f4906..9e6d3ce 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -17,6 +17,7 @@ import re | |||
17 | import copy | 17 | import copy |
18 | import threading | 18 | import threading |
19 | import sys | 19 | import sys |
20 | import six | ||
20 | 21 | ||
21 | try: | 22 | try: |
22 | from urllib.parse import urlparse | 23 | from urllib.parse import urlparse |
@@ -1083,13 +1084,8 @@ class Mastodon: | |||
1083 | """ | 1084 | """ |
1084 | Converts json string IDs to native python bignums. | 1085 | Converts json string IDs to native python bignums. |
1085 | """ | 1086 | """ |
1086 | if sys.version_info.major >= 3: | ||
1087 | str_type = str | ||
1088 | else: | ||
1089 | str_type = unicode | ||
1090 | |||
1091 | if ('id' in json_object and | 1087 | if ('id' in json_object and |
1092 | isinstance(json_object['id'], str_type)): | 1088 | isinstance(json_object['id'], six.text_type)): |
1093 | try: | 1089 | try: |
1094 | json_object['id'] = int(json_object['id']) | 1090 | json_object['id'] = int(json_object['id']) |
1095 | except ValueError: | 1091 | except ValueError: |