py3: slice through bytes to prevent getting ascii value
authorPulkit Goyal <pulkit@yandex-team.ru>
Fri, 14 Sep 2018 23:59:41 +0300
changeset 39632 5a2bf7f941fa
parent 39631 a658f97c1ce4
child 39633 c8e371ee65a4
py3: slice through bytes to prevent getting ascii value I still don't know why python-dev thought it was a nice idea to do this. Differential Revision: https://phab.mercurial-scm.org/D4589
mercurial/patch.py
--- a/mercurial/patch.py	Thu Sep 13 16:22:53 2018 -0400
+++ b/mercurial/patch.py	Fri Sep 14 23:59:41 2018 +0300
@@ -2431,9 +2431,9 @@
     a = ''
     b = ''
     for line in hunklines:
-        if line[0] == '-':
+        if line[0:1] == '-':
             a += line[1:]
-        elif line[0] == '+':
+        elif line[0:1] == '+':
             b += line[1:]
         else:
             raise error.ProgrammingError('unexpected hunk line: %s' % line)