diff options
| author | Sarah Owens <sarato@inkylabs.com> | 2012-11-01 22:59:27 -0700 |
|---|---|---|
| committer | Sarah Owens <sarato@inkylabs.com> | 2012-11-13 17:33:56 -0800 |
| commit | cecd1d864fc3cf02cf50d367111e0d0e173c5dc6 (patch) | |
| tree | b4f660400560dce21cd7a00ffe5a5d74b54bcb81 /subcmds/cherry_pick.py | |
| parent | fc241240d828d7e8302dc0876608a9d27ae1cbc7 (diff) | |
| download | git-repo-cecd1d864fc3cf02cf50d367111e0d0e173c5dc6.tar.gz git-repo-cecd1d864fc3cf02cf50d367111e0d0e173c5dc6.zip | |
Change print statements to work in python3
This is part of a series of changes to introduce Python3 support.
Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
Diffstat (limited to 'subcmds/cherry_pick.py')
| -rw-r--r-- | subcmds/cherry_pick.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py index 7a6d4c201..0cefec13e 100644 --- a/subcmds/cherry_pick.py +++ b/subcmds/cherry_pick.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 re import sys from command import Command @@ -46,13 +47,13 @@ change id will be added. capture_stdout = True, capture_stderr = True) if p.Wait() != 0: - print >>sys.stderr, p.stderr + print(p.stderr, file=sys.stderr) sys.exit(1) sha1 = p.stdout.strip() p = GitCommand(None, ['cat-file', 'commit', sha1], capture_stdout=True) if p.Wait() != 0: - print >>sys.stderr, "error: Failed to retrieve old commit message" + print("error: Failed to retrieve old commit message", file=sys.stderr) sys.exit(1) old_msg = self._StripHeader(p.stdout) @@ -62,8 +63,8 @@ change id will be added. capture_stderr = True) status = p.Wait() - print >>sys.stdout, p.stdout - print >>sys.stderr, p.stderr + print(p.stdout, file=sys.stdout) + print(p.stderr, file=sys.stderr) if status == 0: # The cherry-pick was applied correctly. We just need to edit the @@ -76,16 +77,14 @@ change id will be added. capture_stderr = True) p.stdin.write(new_msg) if p.Wait() != 0: - print >>sys.stderr, "error: Failed to update commit message" + print("error: Failed to update commit message", file=sys.stderr) sys.exit(1) else: - print >>sys.stderr, """\ -NOTE: When committing (please see above) and editing the commit message, -please remove the old Change-Id-line and add: -""" - print >>sys.stderr, self._GetReference(sha1) - print >>sys.stderr + print('NOTE: When committing (please see above) and editing the commit' + 'message, please remove the old Change-Id-line and add:') + print(self._GetReference(sha1), file=stderr) + print(file=stderr) def _IsChangeId(self, line): return CHANGE_ID_RE.match(line) |
