Skip to content

Commit 5409de6

Browse files
committed
Remove debug print statements
1 parent 06072ab commit 5409de6

File tree

4 files changed

+1
-21
lines changed

4 files changed

+1
-21
lines changed

IPython/external/qt_for_kernel.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,13 @@ def matplotlib_options(mpl):
9595
mpqt)
9696

9797
def get_options():
98-
print(f'`get_options` called with {os.environ.get("QT_API", None)=}')
9998
"""Return a list of acceptable QT APIs, in decreasing order of preference."""
10099
#already imported Qt somewhere. Use that
101100
loaded = loaded_api()
102101
if loaded is not None:
103-
print(f"`QtCore` already imported: {loaded=}")
104102
return [loaded]
105103

106104
mpl = sys.modules.get("matplotlib", None)
107-
print(f"{mpl=}") # will be None of matplotlib has not yet been imported
108105

109106
if mpl is not None and tuple(mpl.__version__.split(".")) < ("1", "0", "2"):
110107
# 1.0.1 only supports PyQt4 v1
@@ -126,12 +123,9 @@ def get_options():
126123
raise RuntimeError("Invalid Qt API %r, valid values are: %r" %
127124
(qt_api, ', '.join(_qt_apis)))
128125
else:
129-
print(f"{qt_api=}")
130126
return [qt_api]
131127

132128

133129
api_opts = get_options()
134-
print(f"Importing `IPython.terminal.pt_inputhooks.qt` with {api_opts=}")
135130
QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
136-
print(f"Loaded Qt with {QT_API=}")
137131
enum_helper = enum_factory(QT_API, QtCore)

IPython/terminal/interactiveshell.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,14 +711,12 @@ def inputhook(self, context):
711711

712712
active_eventloop = None
713713
def enable_gui(self, gui=None):
714-
print(f"Someone called `enable_gui` with {gui=}.")
715714
if self._inputhook is not None and gui is not None:
716715
raise RuntimeError("Shell already running a gui event loop.")
717716
if gui and (gui not in {"inline", "webagg"}):
718717
# This hook runs with each cycle of the `prompt_toolkit`'s event loop.
719718
self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui)
720719
else:
721-
print(f"Disconnecting event loop {self._inputhook=}")
722720
self.active_eventloop = self._inputhook = None
723721

724722
# For prompt_toolkit 3.0. We have to create an asyncio event loop with

IPython/terminal/pt_inputhooks/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,13 @@ def set_qt_api(gui):
129129

130130

131131
def get_inputhook_name_and_func(gui):
132-
print(f"`get_inputhook_name_and_func` called with {gui=}")
133132
if gui in registered:
134133
return gui, registered[gui]
135134

136135
if gui not in backends:
137136
raise UnknownBackend(gui)
138137

139138
if gui in aliases:
140-
print("gui has an alias")
141139
return get_inputhook_name_and_func(aliases[gui])
142140

143141
gui_mod = gui

IPython/terminal/pt_inputhooks/qt.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ def _reclaim_excepthook():
2020
sys.excepthook = shell.excepthook
2121

2222

23-
announced = 0
24-
25-
2623
def inputhook(context):
2724
global _appref
2825
app = QtCore.QCoreApplication.instance()
@@ -59,14 +56,7 @@ def inputhook(context):
5956
QtCore.QTimer.singleShot(0, _reclaim_excepthook)
6057

6158
event_loop = QtCore.QEventLoop(app)
62-
global announced
63-
if announced == 0:
64-
print(f"`inputhook` running Qt {QtCore.qVersion()} event loop.")
65-
announced += 1
66-
elif announced == 10:
67-
announced = 0
68-
else:
69-
announced += 1
59+
7060
if sys.platform == 'win32':
7161
# The QSocketNotifier method doesn't appear to work on Windows.
7262
# Use polling instead.

0 commit comments

Comments
 (0)