File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 17
17
18
18
import select
19
19
import errno
20
+ import contextlib
21
+ import io
20
22
21
23
from IPython import get_ipython
22
24
from IPython .terminal .pt_inputhooks import register
@@ -65,7 +67,9 @@ def install():
65
67
if not ip :
66
68
return # Not running in ipython, e.g. doctests
67
69
if ip ._inputhook != sage_inputhook :
68
- ip .enable_gui ('sage' )
70
+ # silence `ip.enable_gui()` useless output
71
+ with contextlib .redirect_stdout (io .StringIO ()):
72
+ ip .enable_gui ('sage' )
69
73
70
74
71
75
def uninstall ():
@@ -81,4 +85,6 @@ def uninstall():
81
85
if not ip :
82
86
return
83
87
if ip ._inputhook == sage_inputhook :
84
- ip .enable_gui (None )
88
+ # silence `ip.enable_gui()` useless output
89
+ with contextlib .redirect_stdout (io .StringIO ()):
90
+ ip .enable_gui (None )
You can’t perform that action at this time.
0 commit comments