web/_exceptions.py
changeset 5385 b6e250dd7a7d
parent 5223 6abd6e3599f4
parent 5377 84d14ddfae13
child 5408 120db445c179
--- a/web/_exceptions.py	Fri Apr 23 11:10:30 2010 +0200
+++ b/web/_exceptions.py	Fri Apr 23 12:42:53 2010 +0200
@@ -53,8 +53,11 @@
         self.reason = reason
 
     def dumps(self):
-        import simplejson
-        return simplejson.dumps({'reason': self.reason})
+        try:
+            from json import dumps
+        except ImportError:
+            from simplejson import dumps
+        return dumps({'reason': self.reason})
 
 class LogOut(PublishException):
     """raised to ask for deauthentication of a logged in user"""