summaryrefslogtreecommitdiffstats
path: root/subcmds/grep.py
diff options
context:
space:
mode:
authorSarah Owens <sarato@inkylabs.com>2012-11-01 22:59:27 -0700
committerSarah Owens <sarato@inkylabs.com>2012-11-13 17:33:56 -0800
commitcecd1d864fc3cf02cf50d367111e0d0e173c5dc6 (patch)
treeb4f660400560dce21cd7a00ffe5a5d74b54bcb81 /subcmds/grep.py
parentfc241240d828d7e8302dc0876608a9d27ae1cbc7 (diff)
downloadgit-repo-cecd1d864fc3cf02cf50d367111e0d0e173c5dc6.tar.gz
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/grep.py')
-rw-r--r--subcmds/grep.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/subcmds/grep.py b/subcmds/grep.py
index b067629a..fa5f8765 100644
--- a/subcmds/grep.py
+++ b/subcmds/grep.py
@@ -13,6 +13,7 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16from __future__ import print_function
16import sys 17import sys
17from color import Coloring 18from color import Coloring
18from command import PagedCommand 19from command import PagedCommand
@@ -178,8 +179,7 @@ contain a line that matches both expressions:
178 have_rev = False 179 have_rev = False
179 if opt.revision: 180 if opt.revision:
180 if '--cached' in cmd_argv: 181 if '--cached' in cmd_argv:
181 print >>sys.stderr,\ 182 print('fatal: cannot combine --cached and --revision', file=sys.stderr)
182 'fatal: cannot combine --cached and --revision'
183 sys.exit(1) 183 sys.exit(1)
184 have_rev = True 184 have_rev = True
185 cmd_argv.extend(opt.revision) 185 cmd_argv.extend(opt.revision)
@@ -230,13 +230,13 @@ contain a line that matches both expressions:
230 out.nl() 230 out.nl()
231 else: 231 else:
232 for line in r: 232 for line in r:
233 print line 233 print(line)
234 234
235 if have_match: 235 if have_match:
236 sys.exit(0) 236 sys.exit(0)
237 elif have_rev and bad_rev: 237 elif have_rev and bad_rev:
238 for r in opt.revision: 238 for r in opt.revision:
239 print >>sys.stderr, "error: can't search revision %s" % r 239 print("error: can't search revision %s" % r, file=sys.stderr)
240 sys.exit(1) 240 sys.exit(1)
241 else: 241 else:
242 sys.exit(1) 242 sys.exit(1)