Skip to content

Commit

Permalink
Merge pull request fastai#158 from radekosmulski/alter_in_ipynb
Browse files Browse the repository at this point in the history
Alter checking for running inside NB
  • Loading branch information
jph00 authored Feb 19, 2018
2 parents 84d8ad2 + 8e1f5ad commit c87aab9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fastai/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ def in_notebook(): return IPKernelApp.initialized()

def in_ipynb():
try:
cfg = get_ipython().config
if cfg['IPKernelApp']['parent_appname'] == 'ipython-notebook':
return True
else:
return False
cls = get_ipython().__class__.__name__
return cls == 'ZMQInteractiveShell'
except NameError:
return False

Expand Down

0 comments on commit c87aab9

Please sign in to comment.