]> granicus.if.org Git - python/commitdiff
SF #726446: raise ValueError if width <= 0.
authorGreg Ward <gward@python.net>
Wed, 7 May 2003 00:55:35 +0000 (00:55 +0000)
committerGreg Ward <gward@python.net>
Wed, 7 May 2003 00:55:35 +0000 (00:55 +0000)
Lib/textwrap.py

index 03fcbc053e9cbb5f9d8a9b0b21da51f862b4065c..fdb95d71637ad482e2e77ea3a3ddb5e69bf20e43 100644 (file)
@@ -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: