We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e59a50 commit 51c5597Copy full SHA for 51c5597
packages/python/plotly/_plotly_utils/optional_imports.py
@@ -23,15 +23,14 @@ def get_module(name, should_load=True):
23
if not should_load:
24
return sys.modules.get(name, None)
25
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
34
- msg = f"Error importing optional module {name}"
35
- logger.exception(msg)
36
-
37
- return None
+ if name not in _not_importable:
+ try:
+ return import_module(name)
+ except ImportError:
+ _not_importable.add(name)
+ except Exception:
+ msg = f"Error importing optional module {name}"
+ logger.exception(msg)
+
+ return None
0 commit comments