Skip to content

Commit 51c5597

Browse files
committed
remove else
1 parent 6e59a50 commit 51c5597

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Diff for: packages/python/plotly/_plotly_utils/optional_imports.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ def get_module(name, should_load=True):
2323
if not should_load:
2424
return sys.modules.get(name, None)
2525

26-
else:
27-
if name not in _not_importable:
28-
try:
29-
return import_module(name)
30-
except ImportError:
31-
_not_importable.add(name)
32-
except Exception:
33-
_not_importable.add(name)
34-
msg = f"Error importing optional module {name}"
35-
logger.exception(msg)
36-
37-
return None
26+
if name not in _not_importable:
27+
try:
28+
return import_module(name)
29+
except ImportError:
30+
_not_importable.add(name)
31+
except Exception:
32+
_not_importable.add(name)
33+
msg = f"Error importing optional module {name}"
34+
logger.exception(msg)
35+
36+
return None

0 commit comments

Comments
 (0)