Commits

Anonymous committed 2abd079

[svn r6486] XmlRpcPlugin: Adding additional check for actually locating the correct JSON library. Closes #5745.

Comments (0)

Files changed (1)

trunk/tracrpc/web_ui.py

 try:
     try:
         import json
-    except:
+        if not (hasattr(json, 'JSONEncoder') \
+                and hasattr(json, 'JSONDecoder')):
+            raise AttributeError("Incorrect JSON library found.")
+    except (ImportError, AttributeError):
         import simplejson as json
 
     class TracRpcJSONEncoder(json.JSONEncoder):