Change print statements to work in python3
This is part of a series of changes to introduce Python3 support.
Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
diff --git a/subcmds/download.py b/subcmds/download.py
index 0abe90d..6aa54af 100644
--- a/subcmds/download.py
+++ b/subcmds/download.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
@@ -68,23 +69,23 @@
for project, change_id, ps_id in self._ParseChangeIds(args):
dl = project.DownloadPatchSet(change_id, ps_id)
if not dl:
- print >>sys.stderr, \
- '[%s] change %d/%d not found' \
- % (project.name, change_id, ps_id)
+ print('[%s] change %d/%d not found'
+ % (project.name, change_id, ps_id),
+ file=sys.stderr)
sys.exit(1)
if not opt.revert and not dl.commits:
- print >>sys.stderr, \
- '[%s] change %d/%d has already been merged' \
- % (project.name, change_id, ps_id)
+ print('[%s] change %d/%d has already been merged'
+ % (project.name, change_id, ps_id),
+ file=sys.stderr)
continue
if len(dl.commits) > 1:
- print >>sys.stderr, \
- '[%s] %d/%d depends on %d unmerged changes:' \
- % (project.name, change_id, ps_id, len(dl.commits))
+ print('[%s] %d/%d depends on %d unmerged changes:' \
+ % (project.name, change_id, ps_id, len(dl.commits)),
+ file=sys.stderr)
for c in dl.commits:
- print >>sys.stderr, ' %s' % (c)
+ print(' %s' % (c), file=sys.stderr)
if opt.cherrypick:
project._CherryPick(dl.commit)
elif opt.revert: