PY-27260: rephrase, use generator instead of list comprehension

This commit is contained in:
Ilya.Kazakevich
2017-12-19 00:00:44 +03:00
parent 55e06a8e46
commit f4d3f5a0d5
+1 -1
View File
@@ -29,7 +29,7 @@ class FileChangesTracker(object):
result = {}
for tmp_folder, sub_dirs, files in os.walk(folder):
sub_dirs[:] = [s for s in sub_dirs if not s.startswith(".")]
if any([fnmatch.fnmatch(os.path.basename(tmp_folder), p) for p in patterns]):
if any(fnmatch.fnmatch(os.path.basename(tmp_folder), p) for p in patterns):
for file in map(lambda f: os.path.join(tmp_folder, f), files):
try:
result.update({file: os.path.getmtime(file)})