run-tests: use a try/except ladder instead of looking for a specific version
authorAugie Fackler <raf@durin42.com>
Mon, 10 Nov 2014 13:20:56 -0500
changeset 23263 dd51abf0aa17
parent 23262 86a8658c77ff
child 23266 3480c07fc934
run-tests: use a try/except ladder instead of looking for a specific version This ensures we get json instead of simplejson in as many places as possible.
tests/run-tests.py
--- a/tests/run-tests.py	Mon Nov 10 13:27:25 2014 -0500
+++ b/tests/run-tests.py	Mon Nov 10 13:20:56 2014 -0500
@@ -61,12 +61,12 @@
 import unittest
 
 try:
-    if sys.version_info < (2, 7):
+    import json
+except ImportError:
+    try:
         import simplejson as json
-    else:
-        import json
-except ImportError:
-    json = None
+    except ImportError:
+        json = None
 
 processlock = threading.Lock()