summaryrefslogtreecommitdiff
path: root/cherrypy/lib
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-09-04 11:47:59 -0400
committerJason R. Coombs <jaraco@jaraco.com>2018-09-04 11:55:19 -0400
commit5f8d4358cfc7580bdb22e471dd1e4b03cc3887c5 (patch)
treee7d0fc5b30a2b2f15c219b5313821e838783b9c7 /cherrypy/lib
parenta7bb4a1416073bf93ab0217099d063810d630818 (diff)
downloadcherrypy-git-5f8d4358cfc7580bdb22e471dd1e4b03cc3887c5.tar.gz
Move json from _cpcompat to its own module.
Diffstat (limited to 'cherrypy/lib')
-rw-r--r--cherrypy/lib/cpstats.py2
-rw-r--r--cherrypy/lib/jsontools.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/cherrypy/lib/cpstats.py b/cherrypy/lib/cpstats.py
index 1bfd354a..28510887 100644
--- a/cherrypy/lib/cpstats.py
+++ b/cherrypy/lib/cpstats.py
@@ -194,7 +194,7 @@ import threading
import time
import cherrypy
-from cherrypy._cpcompat import json
+from cherrypy._json import json
# ------------------------------- Statistics -------------------------------- #
diff --git a/cherrypy/lib/jsontools.py b/cherrypy/lib/jsontools.py
index 48683097..9ca75a8f 100644
--- a/cherrypy/lib/jsontools.py
+++ b/cherrypy/lib/jsontools.py
@@ -1,5 +1,6 @@
import cherrypy
-from cherrypy._cpcompat import text_or_bytes, ntou, json_encode, json_decode
+from cherrypy import _json as json
+from cherrypy._cpcompat import text_or_bytes, ntou
def json_processor(entity):
@@ -9,7 +10,7 @@ def json_processor(entity):
body = entity.fp.read()
with cherrypy.HTTPError.handle(ValueError, 400, 'Invalid JSON document'):
- cherrypy.serving.request.json = json_decode(body.decode('utf-8'))
+ cherrypy.serving.request.json = json.decode(body.decode('utf-8'))
def json_in(content_type=[ntou('application/json'), ntou('text/javascript')],
@@ -56,7 +57,7 @@ def json_in(content_type=[ntou('application/json'), ntou('text/javascript')],
def json_handler(*args, **kwargs):
value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
- return json_encode(value)
+ return json.encode(value)
def json_out(content_type='application/json', debug=False,