mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#488: Fix crash when json-py is installed, which provides a `json` module but is incompatible to simplejson.
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,6 +1,9 @@
|
||||
Release 1.0.2 (in development)
|
||||
==============================
|
||||
|
||||
* #488: Fix crash when json-py is installed, which provides a
|
||||
``json`` module but is incompatible to simplejson.
|
||||
|
||||
* #480: Fix handling of target naming in intersphinx.
|
||||
|
||||
* #486: Fix removal of ``!`` for all cross-reference roles.
|
||||
|
||||
@@ -13,8 +13,10 @@ import UserString
|
||||
|
||||
try:
|
||||
import json
|
||||
# json-py's json module has not JSONEncoder; this will raise AttributeError
|
||||
# if json-py is imported instead of the built-in json module
|
||||
JSONEncoder = json.JSONEncoder
|
||||
except ImportError:
|
||||
except (ImportError, AttributeError):
|
||||
try:
|
||||
import simplejson as json
|
||||
JSONEncoder = json.JSONEncoder
|
||||
|
||||
Reference in New Issue
Block a user