strengthen the max_depth check

This commit is contained in:
Mahmoud Hashemi 2014-02-18 00:12:22 -08:00
parent 0a3755a04b
commit e531c20f56
1 changed files with 2 additions and 2 deletions

View File

@ -192,8 +192,8 @@ class Table(object):
# TODO: seen/cycle detection/reuse ? # TODO: seen/cycle detection/reuse ?
# maxdepth follows the same behavior as find command # maxdepth follows the same behavior as find command
# i.e., it doesn't work if max_depth=0 is passed in # i.e., it doesn't work if max_depth=0 is passed in
if not max_depth: if max_depth < 1:
return cls(headers=headers) return cls(headers=headers) # return data instead?
is_seq = isinstance(data, Sequence) is_seq = isinstance(data, Sequence)
if is_seq: if is_seq:
if not data: if not data: