aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2019-10-20 23:00:09 +0100
committermarmeladema <xademax@gmail.com>2019-10-22 10:16:00 +0100
commit179caed30f717e487000b425f38fa3e03df0ba0c (patch)
tree29ff90691b049c16f9da4f5cd8f6a366d9a5c887 /tests/wpt
parent45817ac26e7a65e786b31ee609481e6aad4a5b15 (diff)
downloadservo-179caed30f717e487000b425f38fa3e03df0ba0c.tar.gz
servo-179caed30f717e487000b425f38fa3e03df0ba0c.zip
tests/wpt/update: Fix print statements to be compatible with Python3
Diffstat (limited to 'tests/wpt')
-rw-r--r--tests/wpt/update/github.py4
-rw-r--r--tests/wpt/update/upstream.py10
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/wpt/update/github.py b/tests/wpt/update/github.py
index 5aaa2aecedc..440e00df028 100644
--- a/tests/wpt/update/github.py
+++ b/tests/wpt/update/github.py
@@ -2,6 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
+from __future__ import print_function
+
import json
from urlparse import urljoin
requests = None
@@ -46,7 +48,7 @@ class GitHub(object):
if 200 <= resp.status_code < 300:
return resp.json()
else:
- print resp.status_code, resp.json()
+ print(resp.status_code, resp.json())
raise GitHubError(resp.status_code, resp.json())
def repo(self, owner, name):
diff --git a/tests/wpt/update/upstream.py b/tests/wpt/update/upstream.py
index 459a3fd54ec..1fa9e59440e 100644
--- a/tests/wpt/update/upstream.py
+++ b/tests/wpt/update/upstream.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
import os
import re
import subprocess
@@ -155,7 +157,7 @@ class SelectCommits(Step):
while True:
commits = state.source_commits[:]
for i, commit in enumerate(commits):
- print "%i:\t%s" % (i, commit.message.summary)
+ print("%i:\t%s" % (i, commit.message.summary))
remove = raw_input("Provide a space-separated list of any commits numbers to remove from the list to upstream:\n").strip()
remove_idx = set()
@@ -178,9 +180,9 @@ class SelectCommits(Step):
keep_commits = [(i,cmt) for i,cmt in enumerate(commits) if i not in remove_idx]
#TODO: consider printed removed commits
- print "Selected the following commits to keep:"
+ print("Selected the following commits to keep:")
for i, commit in keep_commits:
- print "%i:\t%s" % (i, commit.message.summary)
+ print("%i:\t%s" % (i, commit.message.summary))
confirm = raw_input("Keep the above commits? y/n\n").strip().lower()
if confirm == "y":
@@ -210,7 +212,7 @@ class MovePatches(Step):
try:
state.sync_tree.import_patch(stripped_patch, 1 + strip_count)
except:
- print patch.diff
+ print(patch.diff)
raise
state.commits_loaded = i