From cecd1d864fc3cf02cf50d367111e0d0e173c5dc6 Mon Sep 17 00:00:00 2001 From: Sarah Owens Date: Thu, 1 Nov 2012 22:59:27 -0700 Subject: Change print statements to work in python3 This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32 --- subcmds/rebase.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'subcmds/rebase.py') diff --git a/subcmds/rebase.py b/subcmds/rebase.py index a8d58cdb..06cda22c 100644 --- a/subcmds/rebase.py +++ b/subcmds/rebase.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import print_function import sys from command import Command @@ -59,14 +60,16 @@ branch but need to incorporate new upstream changes "underneath" them. one_project = len(all_projects) == 1 if opt.interactive and not one_project: - print >>sys.stderr, 'error: interactive rebase not supported with multiple projects' + print('error: interactive rebase not supported with multiple projects', + file=sys.stderr) return -1 for project in all_projects: cb = project.CurrentBranch if not cb: if one_project: - print >>sys.stderr, "error: project %s has a detatched HEAD" % project.relpath + print("error: project %s has a detatched HEAD" % project.relpath, + file=sys.stderr) return -1 # ignore branches with detatched HEADs continue @@ -74,7 +77,8 @@ branch but need to incorporate new upstream changes "underneath" them. upbranch = project.GetBranch(cb) if not upbranch.LocalMerge: if one_project: - print >>sys.stderr, "error: project %s does not track any remote branches" % project.relpath + print("error: project %s does not track any remote branches" + % project.relpath, file=sys.stderr) return -1 # ignore branches without remotes continue @@ -101,8 +105,8 @@ branch but need to incorporate new upstream changes "underneath" them. args.append(upbranch.LocalMerge) - print >>sys.stderr, '# %s: rebasing %s -> %s' % \ - (project.relpath, cb, upbranch.LocalMerge) + print('# %s: rebasing %s -> %s' + % (project.relpath, cb, upbranch.LocalMerge), file=sys.stderr) needs_stash = False if opt.auto_stash: -- cgit v1.2.3-54-g00ecf