webkitpy: fix json import on linux
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 23:10:46 +0000 (23:10 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 23:10:46 +0000 (23:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76481

Reviewed by Adam Barth.

For some reason, the version of simplejson autoinstalled on my linux
box seems to be broken. We should really only be using
simplejson if json isn't available anyway, so this change looks
for json first.

* Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
(JSONGeneratorTest.test_test_timings_trie):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py

index 96a2613..e7fee55 100644 (file)
@@ -1,5 +1,20 @@
 2012-01-17  Dirk Pranke  <dpranke@chromium.org>
 
+        webkitpy: fix json import on linux
+        https://bugs.webkit.org/show_bug.cgi?id=76481
+
+        Reviewed by Adam Barth.
+
+        For some reason, the version of simplejson autoinstalled on my linux
+        box seems to be broken. We should really only be using
+        simplejson if json isn't available anyway, so this change looks
+        for json first.
+
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+        (JSONGeneratorTest.test_test_timings_trie):
+
+2012-01-17  Dirk Pranke  <dpranke@chromium.org>
+
         Fix failures in test-webkitpy caused by r105177.
 
         Unreviewed, build fix.
index b3e5cbc..b001198 100644 (file)
@@ -37,7 +37,11 @@ from webkitpy.layout_tests.layout_package import json_results_generator
 from webkitpy.layout_tests.models import test_expectations
 from webkitpy.layout_tests.port import test
 from webkitpy.thirdparty.mock import Mock
-from webkitpy.thirdparty import simplejson
+
+try:
+    import json
+except ImportError, e:
+    from webkitpy.thirdparty import simplejson as json
 
 class JSONGeneratorTest(unittest.TestCase):
     def setUp(self):
@@ -229,8 +233,7 @@ class JSONGeneratorTest(unittest.TestCase):
           }
         }
 
-        self.assertEqual(simplejson.dumps(trie), simplejson.dumps(expected_trie))
-
+        self.assertEqual(json.dumps(trie), json.dumps(expected_trie))
 
 
 if __name__ == '__main__':