aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodl <[email protected]>2017-11-26 22:49:32 +0100
committercodl <[email protected]>2017-11-26 22:49:32 +0100
commitb9e6a1e9baf9ec5238dcc3b4344b2a0ae07411ac (patch)
tree3d97d9b20af26e19f2de82d0aa2105dddc7c240a
parentca11ef77acf60fdee5f20fbdb4c3e6ce5f2cbacc (diff)
downloadmastodon.py-b9e6a1e9baf9ec5238dcc3b4344b2a0ae07411ac.tar.gz
fix string id support to also include in_reply_to_... fields
-rw-r--r--mastodon/Mastodon.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 9e6d3ce..c4e50f3 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -1084,12 +1084,13 @@ class Mastodon:
1084 """ 1084 """
1085 Converts json string IDs to native python bignums. 1085 Converts json string IDs to native python bignums.
1086 """ 1086 """
1087 if ('id' in json_object and 1087 for key in ('id', 'in_reply_to_id', 'in_reply_to_account_id'):
1088 isinstance(json_object['id'], six.text_type)): 1088 if (key in json_object and
1089 try: 1089 isinstance(json_object[key], six.text_type)):
1090 json_object['id'] = int(json_object['id']) 1090 try:
1091 except ValueError: 1091 json_object[key] = int(json_object[key])
1092 pass 1092 except ValueError:
1093 pass
1093 1094
1094 return json_object 1095 return json_object
1095 1096
Powered by cgit v1.2.3 (git 2.41.0)