Commits

Robert Brewer  committed 8b2d2cf

Prefer simplejson to the builtin json module. It's usually more advanced and has optional C speedups.

  • Participants
  • Parent commits fad66ac

Comments (0)

Files changed (1)

File cherrypy/lib/jsontools.py

 import sys
 import cherrypy
 
-if sys.version_info >= (2, 6):
-    # Python 2.6: simplejson is part of the standard library
-    import json
-else:
-    try:
-        import simplejson as json
-    except ImportError:
+try:
+    # Prefer simplejson, which is usually more advanced than the builtin module.
+    import simplejson as json
+except ImportError:
+    if sys.version_info >= (2, 6):
+        # Python 2.6: simplejson is part of the standard library
+        import json
+    else:
         json = None
 
 if json is None: