devtools/testlib.py
changeset 5385 b6e250dd7a7d
parent 5274 16461f675734
parent 5377 84d14ddfae13
child 5408 120db445c179
--- a/devtools/testlib.py	Fri Apr 23 11:10:30 2010 +0200
+++ b/devtools/testlib.py	Fri Apr 23 12:42:53 2010 +0200
@@ -17,7 +17,10 @@
 from contextlib import contextmanager
 from warnings import warn
 
-import simplejson
+try:
+    import json
+except ImportError:
+    import simplejson as json
 
 import yams.schema
 
@@ -488,7 +491,7 @@
 
     def remote_call(self, fname, *args):
         """remote json call simulation"""
-        dump = simplejson.dumps
+        dump = json.dumps
         args = [dump(arg) for arg in args]
         req = self.request(fname=fname, pageid='123', arg=args)
         ctrl = self.vreg['controllers'].select('json', req)