changeset 32526:9d08283946f0

minirst: look for column delimiters using slices instead of indicies This works on both Python 2 and 3.
author Augie Fackler <raf@durin42.com>
date Sun, 28 May 2017 15:47:43 -0400
parents 043c147c928d
children 47ce079b1afa
files mercurial/minirst.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: