mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Update cherrypy-18.6.1
This commit is contained in:
parent
b3ae6bd695
commit
ebffd124f6
57 changed files with 1269 additions and 1509 deletions
25
lib/cherrypy/_json.py
Normal file
25
lib/cherrypy/_json.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
"""
|
||||
JSON support.
|
||||
|
||||
Expose preferred json module as json and provide encode/decode
|
||||
convenience functions.
|
||||
"""
|
||||
|
||||
try:
|
||||
# Prefer simplejson
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
|
||||
__all__ = ['json', 'encode', 'decode']
|
||||
|
||||
|
||||
decode = json.JSONDecoder().decode
|
||||
_encode = json.JSONEncoder().iterencode
|
||||
|
||||
|
||||
def encode(value):
|
||||
"""Encode to bytes."""
|
||||
for chunk in _encode(value):
|
||||
yield chunk.encode('utf-8')
|
Loading…
Add table
Add a link
Reference in a new issue