diff --git a/rotator/__init__.py b/rotator/__init__.py index 1218ac7..68a8b76 100644 --- a/rotator/__init__.py +++ b/rotator/__init__.py @@ -19,7 +19,9 @@ def get_files_in_dir(path, regex, timeformat, recurse=False): for root,dirs,files in os.walk(path, topdown=False): for f in files: prefix, timestamp = parse_filename(f, regex, timeformat) - if prefix and prefix not in res: + if not prefix: + continue + if prefix not in res: res[prefix] = set() res[prefix].add((os.path.join(root,f), timestamp)) if not recurse: