changeset 34067:8b8b70cb4288

py3: replace bytes[n] with bytes[n:n + 1] in patch.py where needed
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 16:19:20 +0900
parents 871a58b5f428
children 6d21737c35bf
files mercurial/patch.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Sep 03 16:12:15 2017 +0900
+++ b/mercurial/patch.py	Sun Sep 03 16:19:20 2017 +0900
@@ -1693,7 +1693,7 @@
                              (count, strip, path))
         i += 1
         # consume '//' in the path
-        while i < pathlen - 1 and path[i] == '/':
+        while i < pathlen - 1 and path[i:i + 1] == '/':
             i += 1
         count -= 1
     return path[:i].lstrip(), prefix + path[i:].rstrip()
@@ -1788,7 +1788,7 @@
             else:
                 lr.push(fromfile)
             yield 'file', header
-        elif line[0] == ' ':
+        elif line[0:1] == ' ':
             yield 'context', scanwhile(line, lambda l: l[0] in ' \\')
         elif line[0] in '-+':
             yield 'hunk', scanwhile(line, lambda l: l[0] in '-+\\')