py3: use open() instead of file()
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 05 Feb 2018 13:12:36 +0530
changeset 42120 e35616bb6ede1b75561e850c3f41ae5637cca2ba
parent 42119 3d8b0020f470e2de938aae3027f442f4cf9a5617
child 42121 143d7b27b09c3d04353b146903243d3ad8486507
push id673
push usergszorc@mozilla.com
push dateTue, 06 Feb 2018 20:14:55 +0000
py3: use open() instead of file() file() is not present in Python 3 Differential Revision: https://phab.mercurial-scm.org/D2044
hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -276,17 +276,17 @@ class patchheader(object):
         date = None
         parent = None
         format = None
         subject = None
         branch = None
         nodeid = None
         diffstart = 0
 
-        for line in file(pf):
+        for line in open(pf, 'rb'):
             line = line.rstrip()
             if (line.startswith('diff --git')
                 or (diffstart and line.startswith('+++ '))):
                 diffstart = 2
                 break
             diffstart = 0 # reset
             if line.startswith("--- "):
                 diffstart = 1