From: Greg Ward Date: Wed, 7 May 2003 00:55:35 +0000 (+0000) Subject: SF #726446: raise ValueError if width <= 0. X-Git-Tag: v2.3c1~824 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21820cd92503cb7860fb22e61ccb3796f05e3cb6;p=python SF #726446: raise ValueError if width <= 0. --- diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 03fcbc053e..fdb95d7163 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: