]> git.llucax.com Git - software/pymin.git/commitdiff
Bugfix: handle empty lists on as_table().
authorLeandro Lucarella <llucarella@integratech.com.ar>
Fri, 28 Sep 2007 16:55:51 +0000 (13:55 -0300)
committerLeandro Lucarella <llucarella@integratech.com.ar>
Fri, 28 Sep 2007 16:55:51 +0000 (13:55 -0300)
seqtools.py

index 13e6eacc341da69bbc6ceab71b73804271117a1d..d3de9299446b70b913f77ba293b9c0cccceeac6b 100644 (file)
@@ -92,6 +92,8 @@ def as_table(obj):
         if hasattr(i, '__iter__'):
             return obj
         return (obj,)
+    else:
+        return ((),) # empty table
 
 
 if __name__ == '__main__':
@@ -128,3 +130,5 @@ if __name__ == '__main__':
 
         print f(dict(a=1, b=2))
 
+        print f([])
+