diff options
| author | Georg Brandl <georg@python.org> | 2014-03-01 08:18:23 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2014-03-01 08:18:23 +0100 |
| commit | 2f950d546d7304e7b9d6592d27b47f82b3a424ad (patch) | |
| tree | 54b9419c78a5f725508241c48a1ca731ee9317fa /sphinx/util/jsonimpl.py | |
| parent | 3c649bfde0126d72894989506c40bb8ae35d7d23 (diff) | |
| parent | 4047fe8184c2984241b92754b6e6d6b639b8d09b (diff) | |
| download | sphinx-2f950d546d7304e7b9d6592d27b47f82b3a424ad.tar.gz | |
Update copyright year.
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 8ccbf0cc..05a6ec6e 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): |
