From 590b27ca8a082721edf7051eece0ccf44f9b33d4 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Mon, 12 Sep 2016 16:38:54 +0800 Subject: [PATCH] Add ujson support. --- setup.py | 3 +++ telebot/types.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7215aba..893f8de 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ setup(name='pyTelegramBotAPI', license='GPL2', keywords='telegram bot api tools', install_requires=['requests', 'six'], + extras_require={ + 'json': 'ujson', + }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2', diff --git a/telebot/types.py b/telebot/types.py index f8f4434..bf724bf 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- -import json +try: + import ujson as json +except ImportError: + import json + import six from telebot import util