changeset 32557:6e9a2c9c1f37

minirst: use bytes.strip instead of str.strip
author Augie Fackler <raf@durin42.com>
date Sun, 28 May 2017 13:41:42 -0400
parents 1fb0a85fb20e
children 043c147c928d
files mercurial/minirst.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/minirst.py	Mon May 29 16:21:15 2017 +0530
+++ b/mercurial/minirst.py	Sun May 28 13:41:42 2017 -0400
@@ -452,7 +452,7 @@
 }
 
 def formatoption(block, width):
-    desc = ' '.join(map(str.strip, block['lines']))
+    desc = ' '.join(map(bytes.strip, block['lines']))
     colwidth = encoding.colwidth(block['optstr'])
     usablewidth = width - 1
     hanging = block['optstrwidth']
@@ -474,7 +474,7 @@
         hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
 
         defindent = indent + hang * ' '
-        text = ' '.join(map(str.strip, block['lines']))
+        text = ' '.join(map(bytes.strip, block['lines']))
         return '%s\n%s\n' % (indent + admonition,
                              util.wrap(text, width=width,
                                        initindent=defindent,
@@ -512,7 +512,7 @@
         term = indent + block['lines'][0]
         hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
         defindent = indent + hang * ' '
-        text = ' '.join(map(str.strip, block['lines'][1:]))
+        text = ' '.join(map(bytes.strip, block['lines'][1:]))
         return '%s\n%s\n' % (term, util.wrap(text, width=width,
                                              initindent=defindent,
                                              hangindent=defindent))
@@ -567,7 +567,7 @@
 
         if btype == 'admonition':
             admonition = escape(_admonitiontitles[b['admonitiontitle']])
-            text = escape(' '.join(map(str.strip, lines)))
+            text = escape(' '.join(map(bytes.strip, lines)))
             out.append('<p>\n<b>%s</b> %s\n</p>\n' % (admonition, text))
         elif btype == 'paragraph':
             out.append('<p>\n%s\n</p>\n' % escape('\n'.join(lines)))
@@ -597,7 +597,7 @@
         elif btype == 'definition':
             openlist('dl', level)
             term = escape(lines[0])
-            text = escape(' '.join(map(str.strip, lines[1:])))
+            text = escape(' '.join(map(bytes.strip, lines[1:])))
             out.append(' <dt>%s\n <dd>%s\n' % (term, text))
         elif btype == 'bullet':
             bullet, head = lines[0].split(' ', 1)
@@ -609,12 +609,12 @@
         elif btype == 'field':
             openlist('dl', level)
             key = escape(b['key'])
-            text = escape(' '.join(map(str.strip, lines)))
+            text = escape(' '.join(map(bytes.strip, lines)))
             out.append(' <dt>%s\n <dd>%s\n' % (key, text))
         elif btype == 'option':
             openlist('dl', level)
             opt = escape(b['optstr'])
-            desc = escape(' '.join(map(str.strip, lines)))
+            desc = escape(' '.join(map(bytes.strip, lines)))
             out.append(' <dt>%s\n <dd>%s\n' % (opt, desc))
 
         # close lists if indent level of next block is lower