From dd3ff7f89bdf509083cc18931b9f8e941490fbca Mon Sep 17 00:00:00 2001 From: Mike Koss Date: Fri, 27 Apr 2012 04:16:28 -0700 Subject: [PATCH] fix bug when no help text given for option - wrap returns empty list --- tornado/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/options.py b/tornado/options.py index 5d20dcbf..05e6f6f8 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:]: