We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac740e4 commit 2f20d70Copy full SHA for 2f20d70
telebot/types.py
@@ -62,9 +62,14 @@ def check_json(json_type):
62
:param json_type:
63
:return:
64
"""
65
+ try:
66
+ str_types = (str, unicode)
67
+ except NameError:
68
+ str_types = (str,)
69
+
70
if type(json_type) == dict:
71
return json_type
- elif type(json_type) == str:
72
+ elif type(json_type) in str_types:
73
return json.loads(json_type)
74
else:
75
raise ValueError("json_type should be a json dict or string.")
0 commit comments