8000 Fix `orjson` loading error by emilykl · Pull Request #4562 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Fix orjson loading error #4562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove else
  • Loading branch information
emilykl committed Apr 3, 2024
commit 51c5597dbc55c8db5a7033de49fda7a779aa36e3
23 changes: 11 additions & 12 deletions packages/python/plotly/_plotly_utils/optional_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ def get_module(name, should_load=True):
if not should_load:
return sys.modules.get(name, None)

else:
if name not in _not_importable:
try:
return import_module(name)
except ImportError:
_not_importable.add(name)
except Exception:
_not_importable.add(name)
msg = f"Error importing optional module {name}"
logger.exception(msg)

return None
if name not in _not_importable:
try:
return import_module(name)
except ImportError:
_not_importable.add(name)
except Exception:
_not_importable.add(name)
msg = f"Error importing optional module {name}"
logger.exception(msg)

return None
0