Main Page
Namespaces
Classes
Files
File List
src
rosbridge_library
util
src/rosbridge_library/util/__init__.py
Go to the documentation of this file.
1
# try to import json-lib: 1st try ujson, 2nd try simplejson, else import standard python json
2
try
:
3
import
ujson
as
json
4
except
ImportError:
5
try
:
6
import
simplejson
as
json
7
except
ImportError:
8
import
json
9
10
# Differing string types for Python 2 and 3
11
import
sys
12
if
sys.version_info >= (3, 0):
13
string_types = (str,)
14
from
io
import
StringIO, BytesIO
15
else
:
16
string_types = (str, unicode)
17
from
StringIO
import
StringIO, StringIO
as
BytesIO
18
19
import
bson
20
try
:
21
bson.BSON
22
except
AttributeError:
23
raise
Exception(
24
"BSON installation does not support all necessary features. "
25
"Please use the MongoDB BSON implementation. "
26
"See: https://github.com/RobotWebTools/rosbridge_suite/issues/198"
27
)
rosbridge_library
Author(s): Jonathan Mace
autogenerated on Wed Jun 3 2020 03:55:14