diff options
author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2013-12-15 14:16:53 +0900 |
---|---|---|
committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2013-12-15 14:16:53 +0900 |
commit | a8fc938d1b9fb1be7979da8b8236aba287fc082e (patch) | |
tree | 751d6a1e72f6a59fd036eac63cf01d3c708857a7 /sphinx/util/jsonimpl.py | |
parent | 95a07fe282a084862daca26a0ed781ab498395a8 (diff) | |
download | sphinx-git-a8fc938d1b9fb1be7979da8b8236aba287fc082e.tar.gz |
Drop python-2.5 and remove 2.4,2.5 support codes
Diffstat (limited to 'sphinx/util/jsonimpl.py')
-rw-r--r-- | sphinx/util/jsonimpl.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sphinx/util/jsonimpl.py b/sphinx/util/jsonimpl.py index aa0ea8251..de846b240 100644 --- a/sphinx/util/jsonimpl.py +++ b/sphinx/util/jsonimpl.py @@ -10,27 +10,15 @@ """ import UserString +import json -try: - import json - # json-py's json module has no JSONEncoder; this will raise AttributeError - # if json-py is imported instead of the built-in json module - JSONEncoder = json.JSONEncoder -except (ImportError, AttributeError): - try: - import simplejson as json - JSONEncoder = json.JSONEncoder - except ImportError: - json = None - JSONEncoder = object - - -class SphinxJSONEncoder(JSONEncoder): + +class SphinxJSONEncoder(json.JSONEncoder): """JSONEncoder subclass that forces translation proxies.""" def default(self, obj): if isinstance(obj, UserString.UserString): return unicode(obj) - return JSONEncoder.default(self, obj) + return json.JSONEncoder.default(self, obj) def dump(obj, fp, *args, **kwds): |