# HG changeset patch # User Augie Fackler # Date 2018-08-10 04:08:06 # Node ID de3a9d7ec1c2a6f3bc1f2f8d0cf2f7196bb92160 # Parent 836433f3bdd600dbc26a8424e717893c2392cf46 beautifygraph: use slicing instead of subscripting on bytestr Differential Revision: https://phab.mercurial-scm.org/D4246 diff --git a/hgext/beautifygraph.py b/hgext/beautifygraph.py --- a/hgext/beautifygraph.py +++ b/hgext/beautifygraph.py @@ -55,7 +55,9 @@ def convertedges(line): line = ' %s ' % line pretty = [] for idx in pycompat.xrange(len(line) - 2): - pretty.append(prettyedge(line[idx], line[idx + 1], line[idx + 2])) + pretty.append(prettyedge(line[idx:idx + 1], + line[idx + 1:idx + 2], + line[idx + 2:idx + 3])) return ''.join(pretty) def getprettygraphnode(orig, *args, **kwargs):