Skip to content

Commit

Permalink
aa: fix Python 2.5 wrapping compatibility
Browse files Browse the repository at this point in the history
	modified:   lib/aa.py
	modified:   txt2tags
  • Loading branch information
fgallaire committed Sep 11, 2015
1 parent 2b44989 commit 59707e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/aa.py
Expand Up @@ -294,7 +294,7 @@ def _wrap_chunks(self, chunks):
else:
indent = self.initial_indent
width = self.width - len(indent)
if self.drop_whitespace and chunks[-1].strip() == '' and lines:
if chunks[-1].strip() == '' and lines:
del chunks[-1]
while chunks:
l = lencjk(chunks[-1])
Expand All @@ -305,7 +305,7 @@ def _wrap_chunks(self, chunks):
break
if chunks and lencjk(chunks[-1]) > width:
self._handle_long_word(chunks, cur_line, cur_len, width)
if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':
if cur_line and cur_line[-1].strip() == '':
del cur_line[-1]
if cur_line:
lines.append(indent + ''.join(cur_line))
Expand Down
4 changes: 2 additions & 2 deletions txt2tags
Expand Up @@ -4532,7 +4532,7 @@ class TextWrapperCJK(textwrap.TextWrapper):
else:
indent = self.initial_indent
width = self.width - len(indent)
if self.drop_whitespace and chunks[-1].strip() == '' and lines:
if chunks[-1].strip() == '' and lines:
del chunks[-1]
while chunks:
l = aa_lencjk(chunks[-1])
Expand All @@ -4543,7 +4543,7 @@ class TextWrapperCJK(textwrap.TextWrapper):
break
if chunks and aa_lencjk(chunks[-1]) > width:
self._handle_long_word(chunks, cur_line, cur_len, width)
if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':
if cur_line and cur_line[-1].strip() == '':
del cur_line[-1]
if cur_line:
lines.append(indent + ''.join(cur_line))
Expand Down

0 comments on commit 59707e1

Please sign in to comment.