MEMFS: Ability to exclude a dir during walk

This commit is contained in:
Shahram Najm 2018-03-16 15:18:46 +00:00
parent c7bd5c95db
commit ca106c99ac
1 changed files with 2 additions and 2 deletions

View File

@ -30,9 +30,9 @@ for directory in dirs:
dname = os.path.basename(directory)
NAMES.append(dname)
for dirname, _, files in os.walk(directory):
for dirpath, dirnames, files in os.walk(directory):
for name in files:
full = '%s/%s' % (dirname, name)
full = '%s/%s' % (dirpath, name)
_, ext = os.path.splitext(full)
if ext not in ['.def', '.table', '.tmpl']:
continue