Skip to content

Commit

Permalink
tests/wpt/update: Fix print statements to be compatible with Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Oct 22, 2019
1 parent 45817ac commit 179caed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion tests/wpt/update/github.py
Expand Up @@ -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
Expand Down Expand Up @@ -46,7 +48,7 @@ def _request(self, method, path, data=None):
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):
Expand Down
10 changes: 6 additions & 4 deletions tests/wpt/update/upstream.py
@@ -1,3 +1,5 @@
from __future__ import print_function

import os
import re
import subprocess
Expand Down Expand Up @@ -155,7 +157,7 @@ def create(self, state):
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()
Expand All @@ -178,9 +180,9 @@ def create(self, state):

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":
Expand Down Expand Up @@ -210,7 +212,7 @@ def create(self, state):
try:
state.sync_tree.import_patch(stripped_patch, 1 + strip_count)
except:
print patch.diff
print(patch.diff)
raise
state.commits_loaded = i

Expand Down

0 comments on commit 179caed

Please sign in to comment.