From: Mike Koss Date: Fri, 27 Apr 2012 11:16:28 +0000 (-0700) Subject: fix bug when no help text given for option - wrap returns empty list X-Git-Tag: v2.3.0~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd3ff7f89bdf509083cc18931b9f8e941490fbca;p=thirdparty%2Ftornado.git fix bug when no help text given for option - wrap returns empty list --- diff --git a/tornado/options.py b/tornado/options.py index 5d20dcbf2..05e6f6f89 100644 --- a/tornado/options.py +++ b/tornado/options.py @@ -184,7 +184,7 @@ def print_help(file=sys.stdout): if option.default is not None and option.default != '': description += " (default %s)" % option.default lines = textwrap.wrap(description, 79 - 35) - if len(prefix) > 30: + if len(prefix) > 30 or len(lines) == 0: lines.insert(0, '') print >> file, " --%-30s %s" % (prefix, lines[0]) for line in lines[1:]: