summaryrefslogtreecommitdiffstats
path: root/Lib/textwrap.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2004-05-13 01:53:10 (GMT)
committerGreg Ward <gward@python.net>2004-05-13 01:53:10 (GMT)
commitf0ba764dbbbcc9613c81d3d66a45231f8f79e5cc (patch)
tree4b239d2bd6f040f69982604a8b2b7de27e505b7f /Lib/textwrap.py
parent10c660673eddab34571f1dd73b21fa3f7fc615b3 (diff)
downloadcpython-f0ba764dbbbcc9613c81d3d66a45231f8f79e5cc.zip
cpython-f0ba764dbbbcc9613c81d3d66a45231f8f79e5cc.tar.gz
cpython-f0ba764dbbbcc9613c81d3d66a45231f8f79e5cc.tar.bz2
SF #847346: merge from release23-maint branch: remove misguided
optimization for short input; beef up tests for fix_sentence_endings feature.
Diffstat (limited to 'Lib/textwrap.py')
-rw-r--r--Lib/textwrap.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index f371fbb..d9df019 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -90,14 +90,14 @@ class TextWrapper:
% string.lowercase)
- def __init__ (self,
- width=70,
- initial_indent="",
- subsequent_indent="",
- expand_tabs=True,
- replace_whitespace=True,
- fix_sentence_endings=False,
- break_long_words=True):
+ def __init__(self,
+ width=70,
+ initial_indent="",
+ subsequent_indent="",
+ expand_tabs=True,
+ replace_whitespace=True,
+ fix_sentence_endings=False,
+ break_long_words=True):
self.width = width
self.initial_indent = initial_indent
self.subsequent_indent = subsequent_indent
@@ -268,8 +268,6 @@ class TextWrapper:
"""
text = self._munge_whitespace(text)
indent = self.initial_indent
- if len(text) + len(indent) <= self.width:
- return [indent + text]
chunks = self._split(text)
if self.fix_sentence_endings:
self._fix_sentence_endings(chunks)