Skip to content

Commit e9c3333

Browse files
committed
Fix warning with ipython 8.11
1 parent c00e6c2 commit e9c3333

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/sage/repl/inputhook.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,25 @@ def install():
4747
"""
4848
Install the Sage input hook
4949
50-
EXAMPLES::
50+
EXAMPLES:
51+
52+
Make sure ipython is running so we really test this function::
53+
54+
sage: from sage.repl.interpreter import get_test_shell
55+
sage: get_test_shell()
56+
<sage.repl.interpreter.SageTestShell object at ...>
57+
58+
Run the function twice, to check it is idempotent (see :trac:`35235`)::
5159
5260
sage: from sage.repl.inputhook import install
5361
sage: install()
62+
sage: install()
5463
"""
5564
ip = get_ipython()
5665
if not ip:
5766
return # Not running in ipython, e.g. doctests
58-
ip.enable_gui('sage')
67+
if ip._inputhook != sage_inputhook:
68+
ip.enable_gui('sage')
5969

6070

6171
def uninstall():

0 commit comments

Comments
 (0)