Skip to content

Commit 2f20d70

Browse files
committed
unicode strings for check_json
1 parent ac740e4 commit 2f20d70

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

telebot/types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ def check_json(json_type):
6262
:param json_type:
6363
:return:
6464
"""
65+
try:
66+
str_types = (str, unicode)
67+
except NameError:
68+
str_types = (str,)
69+
6570
if type(json_type) == dict:
6671
return json_type
67-
elif type(json_type) == str:
72+
elif type(json_type) in str_types:
6873
return json.loads(json_type)
6974
else:
7075
raise ValueError("json_type should be a json dict or string.")

0 commit comments

Comments
 (0)