We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9976e2b commit 63103c4Copy full SHA for 63103c4
pandas/core/common.py
@@ -1219,17 +1219,16 @@ def in_interactive_session():
1219
1220
returns True if running under python/ipython interactive shell
1221
"""
1222
- try:
1223
- ipy = __IPYTHON__
1224
- if ipy:
1225
- return True
1226
- except:
1227
- pass
1228
- finally:
+ def check_main():
1229
import __main__ as main
1230
return (not hasattr(main, '__file__') or
1231
get_option('mode.sim_interactive'))
1232
+ try:
+ return __IPYTHON__ or check_main()
+ except:
+ return check_main()
+
1233
def in_qtconsole():
1234
1235
check if we're inside an IPython qtconsole
0 commit comments