1
0
Fork 0
forked from github/pelican

Adding missing call to topdown=True in Generator.get_files

This commit is contained in:
Lucas Cimon 2019-10-17 13:05:53 +02:00
commit e092f7ca75
No known key found for this signature in database
GPG key ID: 08DA831E717571EE
2 changed files with 6 additions and 7 deletions

View file

@ -155,16 +155,15 @@ class Generator(object):
if os.path.isdir(root):
for dirpath, dirs, temp_files in os.walk(
root, followlinks=True):
drop = []
root, topdown=True, followlinks=True):
excl = exclusions_by_dirpath.get(dirpath, ())
for d in dirs:
# We copy the `dirs` list as we will modify it in the loop:
for d in list(dirs):
if (d in excl or
any(fnmatch.fnmatch(d, ignore)
for ignore in ignores)):
drop.append(d)
for d in drop:
dirs.remove(d)
if d in dirs:
dirs.remove(d)
reldir = os.path.relpath(dirpath, self.path)
for f in temp_files: