]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/helpers.py
fix helpers.columnate bug when list is empty
[bup.git] / lib / bup / helpers.py
index 352485951a5684d1b2fbcde206ed27430d38cd4f..65dbc3fd499f63add0bebc55f7dcb6c933846c9e 100644 (file)
@@ -348,6 +348,8 @@ def columnate(l, prefix):
     The number of columns is determined automatically based on the string
     lengths.
     """
+    if not l:
+        return ""
     l = l[:]
     clen = max(len(s) for s in l)
     ncols = (78 - len(prefix)) / (clen + 2)