Don't modify the list in the cache, make a copy

This commit is contained in:
Gina Häußge 2016-08-31 11:49:53 +02:00
parent 5c9ed254ff
commit 9e1f82d977

View file

@ -176,6 +176,9 @@ def _getFileList(origin, path=None, filter=None, recursive=False):
_file_cache["{}:{}:{}:{}".format(origin, path, recursive, filter)] = (files, lastmodified)
def analyse_recursively(files, path=None):
# make a shallow copy in order to not accidentally modify the cached data
files = list(files)
if path is None:
path = ""
@ -233,7 +236,7 @@ def _getFileList(origin, path=None, filter=None, recursive=False):
return files
analyse_recursively(files)
files = analyse_recursively(files)
return files