diff options
author | Greg Ward <gward@python.net> | 2003-05-07 00:55:35 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2003-05-07 00:55:35 (GMT) |
commit | 21820cd92503cb7860fb22e61ccb3796f05e3cb6 (patch) | |
tree | b4bada8db0731e2a394e6e4da9b3828350204161 /Lib | |
parent | 49128575e801bfc1726e2bf4a022cd2e15224ecc (diff) | |
download | cpython-21820cd92503cb7860fb22e61ccb3796f05e3cb6.zip cpython-21820cd92503cb7860fb22e61ccb3796f05e3cb6.tar.gz cpython-21820cd92503cb7860fb22e61ccb3796f05e3cb6.tar.bz2 |
SF #726446: raise ValueError if width <= 0.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/textwrap.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 03fcbc0..fdb95d7 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -197,6 +197,8 @@ class TextWrapper: lines, but apart from that whitespace is preserved. """ lines = [] + if self.width <= 0: + raise ValueError("invalid width %r (must be > 0)" % self.width) while chunks: |