Skip to content

Commit

Permalink
Fix for environment detection in barebones environments.
Browse files Browse the repository at this point in the history
Missing import error catch in environment detection.
  • Loading branch information
nopdive committed Nov 11, 2024
1 parent c7e2fbc commit 2c47707
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions guidance/visual/_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def _detect_ipython(flags: EnvFlags) -> bool:
found = get_ipython() is not None
except NameError: # pragma: no cover
pass
except ImportError: # pragma: no cover
pass
return found


Expand Down Expand Up @@ -131,6 +133,8 @@ def _detect_ipython_zmq(flags: EnvFlags) -> bool:
found = False # Other type (?)
except NameError: # pragma: no cover
found = False # Probably standard Python interpreter
except ImportError: # pragma: no cover
found = False # Probably standard Python interpreter

flags.is_notebook |= found
return found

0 comments on commit 2c47707

Please sign in to comment.