fix for a bug reported by zack.payton@executiveinstruments.com (object of type 'NoneType' has no len())

This commit is contained in:
Miroslav Stampar 2011-02-04 14:05:47 +00:00
parent 14c87ec80d
commit 09e88cfb19

View File

@ -148,7 +148,7 @@ class Dump:
if isinstance(table, (list, tuple, set)): if isinstance(table, (list, tuple, set)):
table = table[0] table = table[0]
maxlength = max(maxlength, len(table)) maxlength = max(maxlength, len(str(table)))
lines = "-" * (int(maxlength) + 2) lines = "-" * (int(maxlength) + 2)
@ -168,7 +168,7 @@ class Dump:
if isinstance(table, (list, tuple, set)): if isinstance(table, (list, tuple, set)):
table = table[0] table = table[0]
blank = " " * (maxlength - len(table)) blank = " " * (maxlength - len(str(table)))
self.__write("| %s%s |" % (table, blank)) self.__write("| %s%s |" % (table, blank))
self.__write("+%s+\n" % lines) self.__write("+%s+\n" % lines)