From fb6631f7563eb9f4ed6374d198da727b480b7834 Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Thu, 17 Oct 2013 13:49:17 -0400 Subject: [PATCH] * Use is_iterable to detect iterable specs argument. --- file/file_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file/file_utils.py b/file/file_utils.py index 5e59235..b2300a6 100644 --- a/file/file_utils.py +++ b/file/file_utils.py @@ -31,6 +31,7 @@ try: except: has_subprocess = False +from wpylib.sugar import is_iterable class super_file(object): '''"Super-file" hack wrapper for a file-like object. @@ -115,7 +116,7 @@ def path_search(*specs, **opts): filetest = opts.get("filetest", os.path.isfile) for spec in specs: - if not getattr(spec, "__iter__", False): + if not is_iterable(spec): # maybe a string? xspecs.append((spec,)) xlen.append(1) else: