py3: slice on bytes instead of indexing
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 29 Dec 2017 05:27:00 +0530
changeset 35583 2f123f309f61
parent 35582 72b91f905065
child 35584 6f62a1c3e11d
py3: slice on bytes instead of indexing Indexing returns the ascii value on Python 3. Differential Revision: https://phab.mercurial-scm.org/D1793
mercurial/mdiff.py
--- a/mercurial/mdiff.py	Fri Dec 29 05:25:27 2017 +0530
+++ b/mercurial/mdiff.py	Fri Dec 29 05:27:00 2017 +0530
@@ -356,7 +356,7 @@
             # the previous hunk context until we find a line starting with an
             # alphanumeric char.
             for i in xrange(astart - 1, lastpos - 1, -1):
-                if l1[i][0].isalnum():
+                if l1[i][0:1].isalnum():
                     func = ' ' + l1[i].rstrip()[:40]
                     lastfunc[1] = func
                     break