]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
fix bug when no help text given for option - wrap returns empty list 487/head
authorMike Koss <mckoss@startpad.org>
Fri, 27 Apr 2012 11:16:28 +0000 (04:16 -0700)
committerMike Koss <mckoss@startpad.org>
Fri, 27 Apr 2012 11:16:28 +0000 (04:16 -0700)
tornado/options.py

index 5d20dcbf218d25600eec61d6f4f2f3cbfdba0881..05e6f6f8992f11b82f1ae85435eaa96b4a208070 100644 (file)
@@ -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:]: