summaryrefslogtreecommitdiffstats
path: root/Lib/textwrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/textwrap.py')
-rw-r--r--Lib/textwrap.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 22a6252..3afc269 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -63,8 +63,8 @@ class TextWrapper:
unicode_whitespace_trans = {}
uspace = ord(' ')
- for x in map(ord, _whitespace):
- unicode_whitespace_trans[x] = uspace
+ for x in _whitespace:
+ unicode_whitespace_trans[ord(x)] = uspace
# This funky little regex is just the trick for splitting
# text up into word-wrappable chunks. E.g.
@@ -136,7 +136,7 @@ class TextWrapper:
'use', ' ', 'the', ' ', '-b', ' ', 'option!'
"""
chunks = self.wordsep_re.split(text)
- chunks = filter(None, chunks) # remove empty chunks
+ chunks = [c for c in chunks if c]
return chunks
def _fix_sentence_endings(self, chunks):