Mercurial > public > mercurial-scm > hg
comparison mercurial/minirst.py @ 37883:a61583cba509
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
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 27 Apr 2018 00:50:08 -0400 |
parents | f0b6fbea00cf |
children | e7aa113b14f7 |
comparison
equal
deleted
inserted
replaced
37882:3d24f708f7b6 | 37883:a61583cba509 |
---|---|
167 line1 = lines[i] | 167 line1 = lines[i] |
168 line2 = i + 1 < len(lines) and lines[i + 1] or '' | 168 line2 = i + 1 < len(lines) and lines[i + 1] or '' |
169 if not itemre.match(line1): | 169 if not itemre.match(line1): |
170 return False | 170 return False |
171 if singleline: | 171 if singleline: |
172 return line2 == '' or line2[0] == ' ' or itemre.match(line2) | 172 return line2 == '' or line2[0:1] == ' ' or itemre.match(line2) |
173 else: | 173 else: |
174 return line2.startswith(' ') | 174 return line2.startswith(' ') |
175 | 175 |
176 i = 0 | 176 i = 0 |
177 while i < len(blocks): | 177 while i < len(blocks): |