From 321740f67471c8fde6cf6ae1694240a74b2ef6be Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 15 Sep 2023 01:06:50 -0700 Subject: [PATCH] weird python relative import error from not having version naming --- nwb_linkml/src/nwb_linkml/providers/schema.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nwb_linkml/src/nwb_linkml/providers/schema.py b/nwb_linkml/src/nwb_linkml/providers/schema.py index a78c5b3..e2323d8 100644 --- a/nwb_linkml/src/nwb_linkml/providers/schema.py +++ b/nwb_linkml/src/nwb_linkml/providers/schema.py @@ -189,7 +189,13 @@ class Provider(ABC): namespace_path = module_path / 'models' / 'pydantic' builtin_namespaces = list(namespace_path.iterdir()) - for ns_dir in builtin_namespaces + list(self.path.iterdir()): + try: + tmp_paths = list(self.path.iterdir()) + except FileNotFoundError: + # fine, just return the builtins + tmp_paths = [] + + for ns_dir in builtin_namespaces + tmp_paths: if not ns_dir.is_dir(): continue if ns_dir.name not in versions.keys():