Bug 829942 - Make jit_test.py Py3k-readier; f=decoder r=terrence+jhammel
authorMs2ger <ms2ger@gmail.com>
Fri, 30 May 2014 09:36:52 +0200
changeset 185730 1971bf0f83eb36b9dfa796349b4a557dffa7f06b
parent 185729 287aca97315e827a5f458f539ceb604348e4e45a
child 185731 b987f3903eb93e24397d4077687d9c59ed8d6d3d
push id26862
push userMs2ger@gmail.com
push dateFri, 30 May 2014 07:39:03 +0000
treeherdermozilla-central@e6f113c83095 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs829942
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 829942 - Make jit_test.py Py3k-readier; f=decoder r=terrence+jhammel
js/src/jit-test/jit_test.py
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -1,13 +1,15 @@
 #!/usr/bin/env python
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import print_function, unicode_literals
+
 import math, os, posixpath, shlex, shutil, subprocess, sys, traceback
 
 def add_libdir_to_path():
     from os.path import dirname, exists, join, realpath
     js_src_dir = dirname(dirname(realpath(sys.argv[0])))
     assert exists(join(js_src_dir,'jsapi.h'))
     sys.path.insert(0, join(js_src_dir, 'lib'))
     sys.path.insert(0, join(js_src_dir, 'tests', 'lib'))
@@ -151,17 +153,17 @@ def main(argv):
 
     if options.exclude:
         exclude_list = []
         for exclude in options.exclude:
             exclude_list += jittests.find_tests(exclude)
         test_list = [ test for test in test_list if test not in set(exclude_list) ]
 
     if not test_list:
-        print >> sys.stderr, "No tests found matching command line arguments."
+        print("No tests found matching command line arguments.", file=sys.stderr)
         sys.exit(0)
 
     test_list = [jittests.Test.from_file(_, options) for _ in test_list]
 
     if not options.run_slow:
         test_list = [ _ for _ in test_list if not _.slow ]
 
     # If chunking is enabled, determine which tests are part of this chunk.
@@ -211,19 +213,19 @@ def main(argv):
         prefix += ['--js-cache-per-process']
 
     # Clean up any remnants from previous crashes etc
     shutil.rmtree(jittests.JS_CACHE_DIR, ignore_errors=True)
     os.mkdir(jittests.JS_CACHE_DIR)
 
     if options.debug:
         if len(job_list) > 1:
-            print 'Multiple tests match command line arguments, debugger can only run one'
+            print('Multiple tests match command line arguments, debugger can only run one')
             for tc in job_list:
-                print '    %s' % tc.path
+                print('    %s' % tc.path)
             sys.exit(1)
 
         tc = job_list[0]
         cmd = ['gdb', '--args'] + tc.command(prefix, jittests.LIB_DIR)
         subprocess.call(cmd)
         sys.exit()
 
     try:
@@ -233,15 +235,15 @@ def main(argv):
         elif options.max_jobs > 1 and jittests.HAVE_MULTIPROCESSING:
             ok = jittests.run_tests_parallel(job_list, prefix, options)
         else:
             ok = jittests.run_tests(job_list, prefix, options)
         if not ok:
             sys.exit(2)
     except OSError:
         if not os.path.exists(prefix[0]):
-            print >> sys.stderr, "JS shell argument: file does not exist: '%s'" % prefix[0]
+            print("JS shell argument: file does not exist: '%s'" % prefix[0], file=sys.stderr)
             sys.exit(1)
         else:
             raise
 
 if __name__ == '__main__':
     main(sys.argv[1:])