Skip to content

Commit

Permalink
Check get_ipython() for None (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
shnela authored Jun 16, 2021
1 parent 8831d0f commit 65533d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## neptune-client 0.9.18

### Fixes
- Check get_ipython() for None ([#598](https://github.com/neptune-ai/neptune-client/pull/598))

## neptune-client 0.9.17

### Features
Expand Down
6 changes: 5 additions & 1 deletion neptune/new/internal/utils/runningmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ def in_notebook():
"""Based on: https://stackoverflow.com/a/22424821/1565454"""
try:
from IPython import get_ipython
if 'IPKernelApp' not in get_ipython().config: # pragma: no cover
ipy = get_ipython()
if ipy is None \
or not hasattr(ipy, 'config') or not isinstance(ipy.config, dict) \
or 'IPKernelApp' not in ipy.config:
return False
except ImportError:
return False

return True

0 comments on commit 65533d8

Please sign in to comment.