Fix bug in print_attribute.

When the attribute had no values an exception was generated while
trying to word-wrap it.
This commit is contained in:
Pavel Zuna 2009-10-22 16:47:22 +02:00 committed by Rob Crittenden
parent 81f8c5f0db
commit 04c5b5ae42

View File

@ -263,7 +263,7 @@ class textui(backend.Backend):
else:
text = ', '.join(value)
line_len = self.get_tty_width()
if line_len:
if line_len and text:
s_indent = '%s%s' % (
CLI_TAB * indent, ' ' * (len(attr) + 2)
)