11789: Converting a filter() iterable to list, for python3 compatibility.
authorLucas Di Pentima <lucas@curoverse.com>
Wed, 28 Jun 2017 02:29:55 +0000 (23:29 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Wed, 28 Jun 2017 02:29:55 +0000 (23:29 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@curoverse.com>

sdk/python/arvados/commands/put.py

index 9fa68ecfe4a3cfc6a587481b6e08fdc96b4882fa..a0f64e1de4a7fa7e2bfd88f4d61c6e074e834d6f 100644 (file)
@@ -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()