Skip to content

Commit

Permalink
Merge pull request #2503 from mdboom/fix-interactive
Browse files Browse the repository at this point in the history
Fix interactive mode detection
  • Loading branch information
mdboom committed Dec 2, 2013
2 parents a81e931 + 02fc261 commit 0b98a14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/matplotlib/__init__.py
Expand Up @@ -1262,7 +1262,11 @@ def interactive(b):

def is_interactive():
'Return true if plot mode is interactive'
b = rcParams['interactive'] and hasattr(sys, 'ps1')
# ps1 exists if the python interpreter is running in an
# interactive console; sys.flags.interactive is true if a script
# is being run via "python -i".
b = rcParams['interactive'] and (
hasattr(sys, 'ps1') or sys.flags.interactive)
return b

def tk_window_focus():
Expand Down

0 comments on commit 0b98a14

Please sign in to comment.