Skip to content

Commit

Permalink
BUG: common.in_interactive_session() returns False after IPython %run…
Browse files Browse the repository at this point in the history
… magic #2585
  • Loading branch information
Chang She committed Dec 28, 2012
1 parent 3cf14ae commit d5b7907
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,16 @@ def in_interactive_session():
returns True if running under python/ipython interactive shell
"""
import __main__ as main
return not hasattr(main, '__file__') or get_option('mode.sim_interactive')
try:
ipy = __IPYTHON__
if ipy:
return True
except:
pass
finally:
import __main__ as main
return (not hasattr(main, '__file__') or
get_option('mode.sim_interactive'))

def in_qtconsole():
"""
Expand Down

0 comments on commit d5b7907

Please sign in to comment.