Replace filter with if/comprehension.
This commit is contained in:
parent
be7035416c
commit
b9bdeb3e9c
3 changed files with 7 additions and 8 deletions
|
|
@ -189,8 +189,7 @@ class ANSITextWrapper(TextWrapper):
|
|||
else:
|
||||
pat = self.wordsep_simple_re_uni
|
||||
chunks = pat.split(_to_ansi(text))
|
||||
chunks = filter(None, chunks) # remove empty chunks
|
||||
return chunks
|
||||
return [chunk for chunk in chunks if chunk] # remove empty chunks
|
||||
|
||||
def _wrap_chunks(self, chunks):
|
||||
"""_wrap_chunks(chunks : [string]) -> [string]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue