diff --git a/IPython/external/qt_for_kernel.py b/IPython/external/qt_for_kernel.py index f88b16b..986cae3 100644 --- a/IPython/external/qt_for_kernel.py +++ b/IPython/external/qt_for_kernel.py @@ -95,16 +95,13 @@ def matplotlib_options(mpl): mpqt) def get_options(): - print(f'`get_options` called with {os.environ.get("QT_API", None)=}') """Return a list of acceptable QT APIs, in decreasing order of preference.""" #already imported Qt somewhere. Use that loaded = loaded_api() if loaded is not None: - print(f"`QtCore` already imported: {loaded=}") return [loaded] mpl = sys.modules.get("matplotlib", None) - print(f"{mpl=}") # will be None of matplotlib has not yet been imported if mpl is not None and tuple(mpl.__version__.split(".")) < ("1", "0", "2"): # 1.0.1 only supports PyQt4 v1 @@ -126,12 +123,9 @@ def get_options(): raise RuntimeError("Invalid Qt API %r, valid values are: %r" % (qt_api, ', '.join(_qt_apis))) else: - print(f"{qt_api=}") return [qt_api] api_opts = get_options() -print(f"Importing `IPython.terminal.pt_inputhooks.qt` with {api_opts=}") QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts) -print(f"Loaded Qt with {QT_API=}") enum_helper = enum_factory(QT_API, QtCore) diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 9bc4114..2179010 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -711,14 +711,12 @@ class TerminalInteractiveShell(InteractiveShell): active_eventloop = None def enable_gui(self, gui=None): - print(f"Someone called `enable_gui` with {gui=}.") if self._inputhook is not None and gui is not None: raise RuntimeError("Shell already running a gui event loop.") 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) else: - print(f"Disconnecting event loop {self._inputhook=}") self.active_eventloop = self._inputhook = None # For prompt_toolkit 3.0. We have to create an asyncio event loop with diff --git a/IPython/terminal/pt_inputhooks/__init__.py b/IPython/terminal/pt_inputhooks/__init__.py index 7a04189..ff13ee4 100644 --- a/IPython/terminal/pt_inputhooks/__init__.py +++ b/IPython/terminal/pt_inputhooks/__init__.py @@ -129,7 +129,6 @@ def set_qt_api(gui): def get_inputhook_name_and_func(gui): - print(f"`get_inputhook_name_and_func` called with {gui=}") if gui in registered: return gui, registered[gui] @@ -137,7 +136,6 @@ def get_inputhook_name_and_func(gui): raise UnknownBackend(gui) if gui in aliases: - print("gui has an alias") return get_inputhook_name_and_func(aliases[gui]) gui_mod = gui diff --git a/IPython/terminal/pt_inputhooks/qt.py b/IPython/terminal/pt_inputhooks/qt.py index d8b4536..cf6d11e 100644 --- a/IPython/terminal/pt_inputhooks/qt.py +++ b/IPython/terminal/pt_inputhooks/qt.py @@ -20,9 +20,6 @@ def _reclaim_excepthook(): sys.excepthook = shell.excepthook -announced = 0 - - def inputhook(context): global _appref app = QtCore.QCoreApplication.instance() @@ -59,14 +56,7 @@ def inputhook(context): QtCore.QTimer.singleShot(0, _reclaim_excepthook) event_loop = QtCore.QEventLoop(app) - global announced - if announced == 0: - print(f"`inputhook` running Qt {QtCore.qVersion()} event loop.") - announced += 1 - elif announced == 10: - announced = 0 - else: - announced += 1 + if sys.platform == 'win32': # The QSocketNotifier method doesn't appear to work on Windows. # Use polling instead.