diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-08 21:01:59 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-08 21:01:59 -0400 |
commit | 435ceb00c34deba31efafa7ad5c1320ae704e127 (patch) | |
tree | 199ff68e57a8e4335da4c6bf3becc68c4c33d6aa /cherrypy/_cpcompat.py | |
parent | 5af46f1848d9a5c60c6b2978f31309b2b81ba697 (diff) | |
download | cherrypy-git-435ceb00c34deba31efafa7ad5c1320ae704e127.tar.gz |
Remove Python 2.5 compatibilty for json
Diffstat (limited to 'cherrypy/_cpcompat.py')
-rw-r--r-- | cherrypy/_cpcompat.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/cherrypy/_cpcompat.py b/cherrypy/_cpcompat.py index 06b430af..bf38eefd 100644 --- a/cherrypy/_cpcompat.py +++ b/cherrypy/_cpcompat.py @@ -239,19 +239,10 @@ try: json_decode = json.JSONDecoder().decode _json_encode = json.JSONEncoder().iterencode except ImportError: - if sys.version_info >= (2, 6): - # Python >=2.6 : json is part of the standard library - import json - json_decode = json.JSONDecoder().decode - _json_encode = json.JSONEncoder().iterencode - else: - json = None - - def json_decode(s): - raise ValueError('No JSON library is available') - - def _json_encode(s): - raise ValueError('No JSON library is available') + # json is part of the standard library + import json + json_decode = json.JSONDecoder().decode + _json_encode = json.JSONEncoder().iterencode finally: if json and six.PY3: # The two Python 3 implementations (simplejson/json) |