From 21820cd92503cb7860fb22e61ccb3796f05e3cb6 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Wed, 7 May 2003 00:55:35 +0000 Subject: [PATCH] SF #726446: raise ValueError if width <= 0. --- Lib/textwrap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 03fcbc053e9..fdb95d71637 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: