1
0
mirror of https://github.com/django/django.git synced 2024-12-25 10:35:48 +00:00

[py3] Removed gratuitous use of map/lambda

that causes a test failure on Python 3 because map returns an iterator.
This commit is contained in:
Aymeric Augustin 2012-08-18 11:55:36 +02:00
parent 85e7a5e140
commit 16ab519f62

View File

@ -55,8 +55,7 @@ def walk(root, topdown=True, onerror=None, followlinks=False,
if ignore_patterns is None:
ignore_patterns = []
dir_suffix = '%s*' % os.sep
norm_patterns = map(lambda p: p.endswith(dir_suffix)
and p[:-len(dir_suffix)] or p, ignore_patterns)
norm_patterns = [p[:-len(dir_suffix)] if p.endswith(dir_suffix) else p for p in ignore_patterns]
for dirpath, dirnames, filenames in os.walk(root, topdown, onerror):
remove_dirs = []
for dirname in dirnames: