Skip to content
Snippets Groups Projects
Commit 737fc3be authored by Ximin Luo's avatar Ximin Luo
Browse files

Fix lazy expression, filter is lazy in python 3

parent 4366e7bd
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ def specialize(file):
else:
re_tests = [(cls.RE_FILE_TYPE, file.magic_file_type),
(cls.RE_FILE_EXTENSION, file.name)]
re_tests = filter(lambda pair: pair[0], re_tests)
re_tests = list(filter(lambda pair: pair[0], re_tests))
if re_tests: # if neither are defined, it's *not* a match
flag = all(bool(pair[0].search(pair[1])) for pair in re_tests)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment