weird python relative import error from not having version naming

This commit is contained in:
sneakers-the-rat 2023-09-15 01:06:50 -07:00
parent 1f61dca46f
commit 321740f674

View file

@ -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():