Skip to content

Commit

Permalink
Merge pull request #320 from martinRenou/lazy_imports
Browse files Browse the repository at this point in the history
Lazily import modules like numpy/pandas/keras
  • Loading branch information
martinRenou authored Sep 5, 2024
2 parents cf8b0dc + 42c2467 commit dd7e695
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/inspectorscripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ __xr = None
def _attempt_import(module):
try:
return __import__(module)
# Only "import" if it was already imported
if module in sys.modules:
return __import__(module)
except ImportError:
return None
Expand Down

0 comments on commit dd7e695

Please sign in to comment.