Skip to content

Commit dfd9730

Browse files
Bordalexierule
authored andcommitted
fix import failer (#12676)
1 parent 6aca974 commit dfd9730

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytorch_lightning/utilities/imports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _module_available(module_path: str) -> bool:
5454
return False
5555
try:
5656
importlib.import_module(module_path)
57-
except ModuleNotFoundError:
57+
except ImportError:
5858
return False
5959
return True
6060

@@ -67,7 +67,7 @@ def _compare_version(package: str, op: Callable, version: str, use_base_version:
6767
"""
6868
try:
6969
pkg = importlib.import_module(package)
70-
except (ModuleNotFoundError, DistributionNotFound):
70+
except (ImportError, DistributionNotFound):
7171
return False
7272
try:
7373
if hasattr(pkg, "__version__"):

0 commit comments

Comments
 (0)