minirst: look for column delimiters using slices instead of indicies
authorAugie Fackler <raf@durin42.com>
Sun, 28 May 2017 15:47:43 -0400
changeset 32526 9d08283946f0
parent 32525 043c147c928d
child 32527 47ce079b1afa
minirst: look for column delimiters using slices instead of indicies This works on both Python 2 and 3.
mercurial/minirst.py
--- a/mercurial/minirst.py	Sun May 28 13:36:02 2017 -0400
+++ b/mercurial/minirst.py	Sun May 28 15:47:43 2017 -0400
@@ -315,7 +315,8 @@
             # column markers are ASCII so we can calculate column
             # position in bytes
             columns = [x for x in xrange(len(div))
-                       if div[x] == '=' and (x == 0 or div[x - 1] == ' ')]
+                       if div[x:x + 1] == '=' and (x == 0 or
+                                                   div[x - 1:x] == ' ')]
             rows = []
             for l in block['lines'][1:-1]:
                 if l == div: