summaryrefslogtreecommitdiffstats
path: root/scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-02-01 21:13:23 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-02-02 14:26:12 +0200
commit781d71db20b0c5acbe940eff1b1ef2f1b765ce54 (patch)
tree444ef9944a789eaf7d51729d8e84f0b1ab70bda4 /scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py
parent7b39a77194c736194b40a40fdd19928b98310959 (diff)
zmq os independent
Change-Id: Iaf5a782be4db26a979a7535454719e8e62b5969a Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py')
-rw-r--r--scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py b/scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py
deleted file mode 100644
index 865ca6d5..00000000
--- a/scripts/external_libs/pyzmq-14.5.0/python3/cel59/64bit/zmq/utils/jsonapi.py
+++ /dev/null
@@ -1,59 +0,0 @@
-"""Priority based json library imports.
-
-Always serializes to bytes instead of unicode for zeromq compatibility
-on Python 2 and 3.
-
-Use ``jsonapi.loads()`` and ``jsonapi.dumps()`` for guaranteed symmetry.
-
-Priority: ``simplejson`` > ``jsonlib2`` > stdlib ``json``
-
-``jsonapi.loads/dumps`` provide kwarg-compatibility with stdlib json.
-
-``jsonapi.jsonmod`` will be the module of the actual underlying implementation.
-"""
-
-# Copyright (C) PyZMQ Developers
-# Distributed under the terms of the Modified BSD License.
-
-from zmq.utils.strtypes import bytes, unicode
-
-jsonmod = None
-
-priority = ['simplejson', 'jsonlib2', 'json']
-for mod in priority:
- try:
- jsonmod = __import__(mod)
- except ImportError:
- pass
- else:
- break
-
-def dumps(o, **kwargs):
- """Serialize object to JSON bytes (utf-8).
-
- See jsonapi.jsonmod.dumps for details on kwargs.
- """
-
- if 'separators' not in kwargs:
- kwargs['separators'] = (',', ':')
-
- s = jsonmod.dumps(o, **kwargs)
-
- if isinstance(s, unicode):
- s = s.encode('utf8')
-
- return s
-
-def loads(s, **kwargs):
- """Load object from JSON bytes (utf-8).
-
- See jsonapi.jsonmod.loads for details on kwargs.
- """
-
- if str is unicode and isinstance(s, bytes):
- s = s.decode('utf8')
-
- return jsonmod.loads(s, **kwargs)
-
-__all__ = ['jsonmod', 'dumps', 'loads']
-