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

Skip to content

Call IPython.enable_gui when install repl displayhook #28332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,12 @@ def install_repl_displayhook() -> None:
# This code can be removed when Python 3.12, the latest version supported by
# IPython < 8.24, reaches end-of-life in late 2028.
from IPython.core.pylabtools import backend2gui
# trigger IPython's eventloop integration, if available
ipython_gui_name = backend2gui.get(get_backend())
if ipython_gui_name:
ip.enable_gui(ipython_gui_name)
else:
_, ipython_gui_name = backend_registry.resolve_backend(get_backend())
# trigger IPython's eventloop integration, if available
if ipython_gui_name:
ip.enable_gui(ipython_gui_name)


def uninstall_repl_displayhook() -> None:
Expand Down
Loading