mirror of
https://github.com/p2p-ld/nwb-linkml.git
synced 2024-11-10 00:34:29 +00:00
clear repo imports before returning from sys.module
This commit is contained in:
parent
0f4f2dd683
commit
15d1f0d7b1
1 changed files with 5 additions and 2 deletions
|
@ -730,6 +730,10 @@ class PydanticProvider(Provider):
|
||||||
|
|
||||||
module_name = self.module_name(namespace, version)
|
module_name = self.module_name(namespace, version)
|
||||||
namespace_name = module_name + '.namespace'
|
namespace_name = module_name + '.namespace'
|
||||||
|
|
||||||
|
if not allow_repo:
|
||||||
|
self._clear_package_imports()
|
||||||
|
|
||||||
if namespace_name in sys.modules:
|
if namespace_name in sys.modules:
|
||||||
return sys.modules[namespace_name]
|
return sys.modules[namespace_name]
|
||||||
|
|
||||||
|
@ -741,8 +745,7 @@ class PydanticProvider(Provider):
|
||||||
if path is None or not path.exists():
|
if path is None or not path.exists():
|
||||||
_ = self.build(namespace, version=version)
|
_ = self.build(namespace, version=version)
|
||||||
|
|
||||||
if not allow_repo:
|
|
||||||
self._clear_package_imports()
|
|
||||||
|
|
||||||
module = self.import_module(namespace, version)
|
module = self.import_module(namespace, version)
|
||||||
return module
|
return module
|
||||||
|
|
Loading…
Reference in a new issue