Skip to content

Commit 590b27c

Browse files
committed
Add ujson support.
1 parent 404f81f commit 590b27c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def readme():
1717
license='GPL2',
1818
keywords='telegram bot api tools',
1919
install_requires=['requests', 'six'],
20+
extras_require={
21+
'json': 'ujson',
22+
},
2023
classifiers=[
2124
'Development Status :: 5 - Production/Stable',
2225
'Programming Language :: Python :: 2',

telebot/types.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# -*- coding: utf-8 -*-
22

3-
import json
3+
try:
4+
import ujson as json
5+
except ImportError:
6+
import json
7+
48
import six
59

610
from telebot import util

0 commit comments

Comments
 (0)