Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fbd29f

Browse files
committed
Only turn on interactive mode if in a console.
1 parent 705fae3 commit 9fbd29f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ def interactive(b):
11701170

11711171
def is_interactive():
11721172
'Return true if plot mode is interactive'
1173-
b = rcParams['interactive']
1173+
b = rcParams['interactive'] and hasattr(sys, 'ps1')
11741174
return b
11751175

11761176
def tk_window_focus():
@@ -1277,6 +1277,6 @@ def test(verbosity=1):
12771277

12781278
verbose.report('matplotlib version %s'%__version__)
12791279
verbose.report('verbose.level %s'%verbose.level)
1280-
verbose.report('interactive is %s'%rcParams['interactive'])
1280+
verbose.report('interactive is %s'%is_interactive())
12811281
verbose.report('platform is %s'%sys.platform)
12821282
verbose.report('loaded modules: %s'%six.iterkeys(sys.modules), 'debug')

0 commit comments

Comments
 (0)