From: Lucas Di Pentima Date: Wed, 28 Jun 2017 02:29:55 +0000 (-0300) Subject: 11789: Converting a filter() iterable to list, for python3 compatibility. X-Git-Tag: 1.1.0~166^2~4 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/3551a0395c7358e52e0a8f15cca6f149e026e646 11789: Converting a filter() iterable to list, for python3 compatibility. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/sdk/python/arvados/commands/put.py b/sdk/python/arvados/commands/put.py index 9fa68ecfe4..a0f64e1de4 100644 --- a/sdk/python/arvados/commands/put.py +++ b/sdk/python/arvados/commands/put.py @@ -486,22 +486,22 @@ class ArvPutUploadJob(object): root_relpath = '' # Exclude files/dirs by full path matching pattern if self.exclude_paths: - dirs[:] = filter( + dirs[:] = list(filter( lambda d: not any( [pathname_match(os.path.join(root_relpath, d), pat) for pat in self.exclude_paths]), - dirs) - files = filter( + dirs)) + files = list(filter( lambda f: not any( [pathname_match(os.path.join(root_relpath, f), pat) for pat in self.exclude_paths]), - files) + files)) # Exclude files/dirs by name matching pattern if self.exclude_names is not None: - dirs[:] = filter(lambda d: not self.exclude_names.match(d), dirs) - files = filter(lambda f: not self.exclude_names.match(f), files) + dirs[:] = list(filter(lambda d: not self.exclude_names.match(d), dirs)) + files = list(filter(lambda f: not self.exclude_names.match(f), files)) # Make os.walk()'s dir traversing order deterministic dirs.sort() files.sort()