Skip to content

Commit c0a0ab8

Browse files
committed
simplify the use of glob; avoid root_dir keyword argument that is not available in Python 3.9
1 parent 86d7aa6 commit c0a0ab8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pipeline/src/collection.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,10 @@ def load(self, *paths, version=DEFAULT_VERSION):
175175
"""
176176
if len(paths) == 1 and os.path.isdir(paths[0]):
177177
data_dir = paths[0]
178-
json_paths = [
179-
os.path.join(data_dir, item) for item in (
180-
glob("**/*.jsonld", root_dir=data_dir, recursive=True, include_hidden=False)
181-
+ glob("**/*.json", root_dir=data_dir, recursive=True, include_hidden=False))
182-
]
178+
json_paths = (
179+
glob(f"{data_dir}/**/*.jsonld", recursive=True, include_hidden=False)
180+
+ glob(f"{data_dir}/**/*.json", recursive=True, include_hidden=False)
181+
)
183182
else:
184183
json_paths = paths
185184

0 commit comments

Comments
 (0)