util: look for empty-sysstr instead of empty-bytesstr in textwrap code
authorAugie Fackler <raf@durin42.com>
Sun, 28 May 2017 16:17:43 -0400
changeset 32527 47ce079b1afa
parent 32526 9d08283946f0
child 32528 9f56d462634c
util: look for empty-sysstr instead of empty-bytesstr in textwrap code Fixes behavior on Python 3.
mercurial/util.py
--- a/mercurial/util.py	Sun May 28 15:47:43 2017 -0400
+++ b/mercurial/util.py	Sun May 28 16:17:43 2017 -0400
@@ -2310,7 +2310,7 @@
 
                 # First chunk on line is whitespace -- drop it, unless this
                 # is the very beginning of the text (i.e. no lines started yet).
-                if self.drop_whitespace and chunks[-1].strip() == '' and lines:
+                if self.drop_whitespace and chunks[-1].strip() == r'' and lines:
                     del chunks[-1]
 
                 while chunks:
@@ -2332,7 +2332,7 @@
 
                 # If the last chunk on this line is all whitespace, drop it.
                 if (self.drop_whitespace and
-                    cur_line and cur_line[-1].strip() == ''):
+                    cur_line and cur_line[-1].strip() == r''):
                     del cur_line[-1]
 
                 # Convert current line back to a string and store it in list