File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1904,8 +1904,23 @@ def in_qtconsole():
1904
1904
return True
1905
1905
except :
1906
1906
return False
1907
+ return False
1908
+
1909
+ def in_ipnb ():
1910
+ """
1911
+ check if we're inside an IPython Notebook
1912
+ """
1913
+ try :
1914
+ ip = get_ipython ()
1915
+ front_end = (ip .config .get ('KernelApp' ,{}).get ('parent_appname' ,"" ) or
1916
+ ip .config .get ('IPKernelApp' ,{}).get ('parent_appname' ,"" ))
1917
+ if 'notebook' in front_end .lower ():
1918
+ return True
1919
+ except :
1920
+ return False
1921
+ return False
1907
1922
1908
- def in_ipnb_frontend ():
1923
+ def in_ipython_frontend ():
1909
1924
"""
1910
1925
check if we're inside an an IPython zmq frontend
1911
1926
"""
Original file line number Diff line number Diff line change @@ -1718,7 +1718,7 @@ def get_console_size():
1718
1718
# Simple. yeah.
1719
1719
1720
1720
if com .in_interactive_session ():
1721
- if com .in_ipnb_frontend ():
1721
+ if com .in_ipython_frontend ():
1722
1722
# sane defaults for interactive non-shell terminal
1723
1723
# match default for width,height in config_init
1724
1724
from pandas .core .config import get_default_val
You can’t perform that action at this time.
0 commit comments