Patchwork D1793: py3: slice on bytes instead of indexing

login
register
mail settings
Submitter phabricator
Date Jan. 10, 2018, 11:04 p.m.
Message ID <cc34677bb0009673634c8c6ce5ee8e06@localhost.localdomain>
Download mbox | patch
Permalink /patch/26659/
State Not Applicable
Headers show

Comments

phabricator - Jan. 10, 2018, 11:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2f123f309f61: py3: slice on bytes instead of indexing (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1793?vs=4670&id=4776

REVISION DETAIL
  https://phab.mercurial-scm.org/D1793

AFFECTED FILES
  mercurial/mdiff.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -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