68288cdc5a7f

Fix a bug when working with new tasklists.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 28 Sep 2009 23:14:29 -0400
parents 1bbebfb0395f
children b8afd9a5c913
branches/tags (none)
files t.py

Changes

--- a/t.py	Mon Sep 28 07:27:36 2009 -0400
+++ b/t.py	Mon Sep 28 23:14:29 2009 -0400
@@ -61,7 +61,7 @@
     """Parse a list of tasks into tasklines suitable for writing."""
     
     tasklines = []
-    tlen = max(map(lambda t: len(t['text']), tasks))
+    tlen = max(map(lambda t: len(t['text']), tasks)) if tasks else 0
     
     for task in tasks:
         meta = [m for m in task.items() if m[0] != 'text']