aboutsummaryrefslogtreecommitdiffstats
path: root/python/itsdangerous/_json.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-08-09 22:01:04 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-08-09 22:01:04 -0700
commit2e75c6d9603f8a5edf6495f8d4fb3115a67d823c (patch)
tree8fb2d1bec2cf0e50c5fce6bc718f755485419db0 /python/itsdangerous/_json.py
parentcc9283ad5332f59a69a91d9d0fab299779de513c (diff)
parentadc40bc760345a23678a01f27d7697dfd3811914 (diff)
downloadyt-local-2e75c6d9603f8a5edf6495f8d4fb3115a67d823c.tar.lz
yt-local-2e75c6d9603f8a5edf6495f8d4fb3115a67d823c.tar.xz
yt-local-2e75c6d9603f8a5edf6495f8d4fb3115a67d823c.zip
Merge flask framework and other stuff from master
Diffstat (limited to 'python/itsdangerous/_json.py')
-rw-r--r--python/itsdangerous/_json.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/itsdangerous/_json.py b/python/itsdangerous/_json.py
new file mode 100644
index 0000000..426b36e
--- /dev/null
+++ b/python/itsdangerous/_json.py
@@ -0,0 +1,18 @@
+try:
+ import simplejson as json
+except ImportError:
+ import json
+
+
+class _CompactJSON(object):
+ """Wrapper around json module that strips whitespace."""
+
+ @staticmethod
+ def loads(payload):
+ return json.loads(payload)
+
+ @staticmethod
+ def dumps(obj, **kwargs):
+ kwargs.setdefault("ensure_ascii", False)
+ kwargs.setdefault("separators", (",", ":"))
+ return json.dumps(obj, **kwargs)