SF #726446: raise ValueError if width <= 0.

This commit is contained in:
Greg Ward 2003-05-07 00:55:35 +00:00
parent 49128575e8
commit 21820cd925
1 changed files with 2 additions and 0 deletions

View 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: