From a8fc938d1b9fb1be7979da8b8236aba287fc082e Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Sun, 15 Dec 2013 14:16:53 +0900 Subject: Drop python-2.5 and remove 2.4,2.5 support codes --- sphinx/util/jsonimpl.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'sphinx/util/jsonimpl.py') 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): -- cgit v1.2.1