Mini Shell

Direktori : /proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/cherrypy/
Upload File :
Current File : //proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/cherrypy/_json.py

"""
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')

Zerion Mini Shell 1.0