Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vu Anh committed Jun 22, 2024
1 parent 95434e5 commit 8908b76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions underthesea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'dependency_parse': 'underthesea.pipeline.dependency_parse'
}


@lru_cache(maxsize=None)
def get_optional_import(module_name, object_name):
try:
Expand All @@ -57,6 +58,7 @@ def get_optional_import(module_name, object_name):
except ImportError:
return None


for name, module in optional_imports.items():
globals()[name] = get_optional_import(module, name)

Expand Down

0 comments on commit 8908b76

Please sign in to comment.