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

This commit is contained in:
Gina Häußge committed 2016-08-31 11:49:53 +02:00
1 parent 5c9ed254ff
commit 9e1f82d977
1 file changed
+4 -1
+4 -1
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