beautifygraph: use slicing instead of subscripting on bytestr
authorAugie Fackler <augie@google.com>
Fri, 10 Aug 2018 00:08:06 -0400
changeset 39054 de3a9d7ec1c2
parent 39053 836433f3bdd6
child 39055 dcecf772756a
beautifygraph: use slicing instead of subscripting on bytestr Differential Revision: https://phab.mercurial-scm.org/D4246
hgext/beautifygraph.py
--- a/hgext/beautifygraph.py	Fri Aug 10 00:07:45 2018 -0400
+++ b/hgext/beautifygraph.py	Fri Aug 10 00:08:06 2018 -0400
@@ -55,7 +55,9 @@
     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):