aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/command_base.py12
-rw-r--r--python/servo/lints/wpt_lint.py4
-rw-r--r--python/servo/mutation/mutator.py6
3 files changed, 14 insertions, 8 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 7f4e941a4c7..67f91e6a1d4 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -7,6 +7,8 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
+from __future__ import print_function
+
from errno import ENOENT as NO_SUCH_FILE_OR_DIRECTORY
from glob import glob
import shutil
@@ -350,15 +352,15 @@ class CommandBase(object):
version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"])
except OSError as e:
if e.errno == NO_SUCH_FILE_OR_DIRECTORY:
- print "It looks like rustup is not installed. See instructions at " \
- "https://github.com/servo/servo/#setting-up-your-environment"
- print
+ print("It looks like rustup is not installed. See instructions at "
+ "https://github.com/servo/servo/#setting-up-your-environment")
+ print()
return 1
raise
version = tuple(map(int, re.match("rustup (\d+)\.(\d+)\.(\d+)", version_line).groups()))
if version < (1, 11, 0):
- print "rustup is at version %s.%s.%s, Servo requires 1.11.0 or more recent." % version
- print "Try running 'rustup self update'."
+ print("rustup is at version %s.%s.%s, Servo requires 1.11.0 or more recent." % version)
+ print("Try running 'rustup self update'.")
return 1
toolchain = self.toolchain()
if platform.system() == "Windows":
diff --git a/python/servo/lints/wpt_lint.py b/python/servo/lints/wpt_lint.py
index a1c7e528c77..e2e44c729ae 100644
--- a/python/servo/lints/wpt_lint.py
+++ b/python/servo/lints/wpt_lint.py
@@ -7,6 +7,8 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
+from __future__ import print_function
+
import os
import sys
@@ -20,7 +22,7 @@ class Lint(LintRunner):
def _get_wpt_files(self, suite):
working_dir = os.path.join(WPT_PATH, suite, '')
file_iter = self.get_files(working_dir, exclude_dirs=[])
- print '\nRunning the WPT lint on %s...' % working_dir
+ print('\nRunning the WPT lint on %s...' % working_dir)
for f in file_iter:
if filter_file(f):
yield f[len(working_dir):]
diff --git a/python/servo/mutation/mutator.py b/python/servo/mutation/mutator.py
index f92b388e487..8018ddc6116 100644
--- a/python/servo/mutation/mutator.py
+++ b/python/servo/mutation/mutator.py
@@ -7,6 +7,8 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
+from __future__ import print_function
+
import fileinput
import re
import random
@@ -28,7 +30,7 @@ def init_variables(if_blocks):
def deleteStatements(file_name, line_numbers):
for line in fileinput.input(file_name, inplace=True):
if fileinput.lineno() not in line_numbers:
- print line.rstrip()
+ print(line.rstrip())
class Strategy:
@@ -48,7 +50,7 @@ class Strategy:
for line in fileinput.input(file_name, inplace=True):
if fileinput.lineno() == mutation_line_number:
line = re.sub(self._replace_strategy['regex'], self._replace_strategy['replaceString'], line)
- print line.rstrip()
+ print(line.rstrip())
return mutation_line_number