mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 23:27:49 +01:00
use ujson as JSON en/decoder if available
This commit is contained in:
parent
ffff0938f4
commit
fcda567f8c
3 changed files with 13 additions and 3 deletions
|
@ -18,7 +18,11 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
"""Base class for Telegram Objects."""
|
"""Base class for Telegram Objects."""
|
||||||
|
|
||||||
import json
|
try:
|
||||||
|
import ujson as json
|
||||||
|
except ImportError:
|
||||||
|
import json
|
||||||
|
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,10 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
"""This module contains methods to make POST and GET requests"""
|
"""This module contains methods to make POST and GET requests"""
|
||||||
|
|
||||||
import json
|
try:
|
||||||
|
import ujson as json
|
||||||
|
except ImportError:
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -3,7 +3,10 @@ import logging
|
||||||
from telegram import Update
|
from telegram import Update
|
||||||
from future.utils import bytes_to_native_str
|
from future.utils import bytes_to_native_str
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
import json
|
try:
|
||||||
|
import ujson as json
|
||||||
|
except ImportError:
|
||||||
|
import json
|
||||||
try:
|
try:
|
||||||
import BaseHTTPServer
|
import BaseHTTPServer
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
Loading…
Reference in a new issue