minirst: fix bytes slicing defect on Python 3
authorAugie Fackler <augie@google.com>
Fri, 27 Apr 2018 00:50:08 -0400
changeset 37883 a61583cba509
parent 37882 3d24f708f7b6
child 37884 72284d296b02
minirst: fix bytes slicing defect on Python 3 This is the only lingering problem in minirst on Python 3. test-minirst.py now passes on Python 3. Differential Revision: https://phab.mercurial-scm.org/D3478
contrib/python3-whitelist
mercurial/minirst.py
--- a/contrib/python3-whitelist	Fri Apr 27 00:46:05 2018 -0400
+++ b/contrib/python3-whitelist	Fri Apr 27 00:50:08 2018 -0400
@@ -258,6 +258,7 @@
 test-merge8.t
 test-merge9.t
 test-minifileset.py
+test-minirst.py
 test-mq-git.t
 test-mq-header-date.t
 test-mq-header-from.t
--- a/mercurial/minirst.py	Fri Apr 27 00:46:05 2018 -0400
+++ b/mercurial/minirst.py	Fri Apr 27 00:50:08 2018 -0400
@@ -169,7 +169,7 @@
         if not itemre.match(line1):
             return False
         if singleline:
-            return line2 == '' or line2[0] == ' ' or itemre.match(line2)
+            return line2 == '' or line2[0:1] == ' ' or itemre.match(line2)
         else:
             return line2.startswith(' ')