1. Olemis Lang
  2. trac-rpc-dev

Commits

osimons  committed 2abd079

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

  • Participants
  • Parent commits 9cb47a8
  • Branches xmlrpcplugin

Comments (0)

Files changed (1)

File trunk/tracrpc/web_ui.py

View file
  • Ignore whitespace
 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):