# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-12-28 23:57:00 # Node ID 2f123f309f617ff70a0951a9e2f633dc312db287 # Parent 72b91f905065c366e3a2ce3dcb9bb24ffd66b109 py3: slice on bytes instead of indexing Indexing returns the ascii value on Python 3. Differential Revision: https://phab.mercurial-scm.org/D1793 diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -356,7 +356,7 @@ def _unidiff(t1, t2, opts=defaultopts): # 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