From 9d9b2ba450b3f26ad79a22acf4c09255f41eefc0 Mon Sep 17 00:00:00 2001 From: George Date: Mon, 11 Sep 2023 08:55:25 -0400 Subject: [PATCH] Return appropriate files (#363) --- src/sparsezoo/objects/directory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sparsezoo/objects/directory.py b/src/sparsezoo/objects/directory.py index fe98778c..86c1e72f 100644 --- a/src/sparsezoo/objects/directory.py +++ b/src/sparsezoo/objects/directory.py @@ -212,7 +212,7 @@ def get_file(self, file_name: str) -> Optional[File]: for file in self.files: if file is None: continue - if file.name == file_name: + if file.name == os.path.basename(file_name): return file if isinstance(file, Directory): file = file.get_file(file_name=file_name)