Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
desmondcheongzx committed Sep 11, 2024
1 parent d294846 commit d9cd2d6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions daft/lazy_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ class LazyImport:
"""

def __init__(self, module_name: str):
self._import_attempted = False
self._module_name = module_name
self._module = None

def module_available(self):
return self._load_module is not None
return self._load_module() is not None

def _load_module(self):
if not self._import_attempted and self._module is None:
self._import_attempted = True
if self._module is None:
try:
self._module = importlib.import_module(self._module_name)
except ImportError:
Expand Down

0 comments on commit d9cd2d6

Please sign in to comment.