From c2484fb141e80c22cb442f496ac9add2bc1361f1 2023-02-28 22:37:26 From: Emilio Graff <1@emil.io> Date: 2023-02-28 22:37:26 Subject: [PATCH] BF: make this an error People can't switch Qt versions willy-nilly anyway. --- diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 57f7833..4d1a607 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -915,8 +915,9 @@ class TerminalInteractiveShell(InteractiveShell): def enable_gui(self, gui=None): if self._inputhook is not None and gui is not None: print( - f"Shell was already running a gui event loop for {self.active_eventloop}; switching to {gui}." + f"Shell is already running a gui event loop for {self.active_eventloop}." ) + return if gui and (gui not in {"inline", "webagg"}): # This hook runs with each cycle of the `prompt_toolkit`'s event loop. self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui)