summaryrefslogtreecommitdiffstats
path: root/Lib/textwrap.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-31 10:37:15 (GMT)
committerGeorg Brandl <georg@python.org>2007-08-31 10:37:15 (GMT)
commit7f13e6b3e2546a7d6402f969113d928cc1d58dfc (patch)
tree1b6b41e5a53beb659964a72d8f064c9ecdb0d5ed /Lib/textwrap.py
parent226878cba507cff4b6ce094063682d0b0b53cbb9 (diff)
downloadcpython-7f13e6b3e2546a7d6402f969113d928cc1d58dfc.zip
cpython-7f13e6b3e2546a7d6402f969113d928cc1d58dfc.tar.gz
cpython-7f13e6b3e2546a7d6402f969113d928cc1d58dfc.tar.bz2
string.maketrans() now produces translation tables for bytes.translate() -- wrong module?
Fix all remaining instances that did bad things with the new str.translate().
Diffstat (limited to 'Lib/textwrap.py')
-rw-r--r--Lib/textwrap.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 3fc14f0..e6e1b97 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -59,8 +59,6 @@ class TextWrapper:
Drop leading and trailing whitespace from lines.
"""
- whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace))
-
unicode_whitespace_trans = {}
uspace = ord(' ')
for x in _whitespace:
@@ -116,10 +114,7 @@ class TextWrapper:
if self.expand_tabs:
text = text.expandtabs()
if self.replace_whitespace:
- if isinstance(text, str8):
- text = text.translate(self.whitespace_trans)
- elif isinstance(text, str):
- text = text.translate(self.unicode_whitespace_trans)
+ text = text.translate(self.unicode_whitespace_trans)
return text