Skip to content

Commit 5586475

Browse files
authored
Do not write to stdout on debugging
Write to stderr instead of stdout when changing Matplotlib interactivity. Otherwise the doctests will fail when debugging them. I tested this by changing it manually on my VSCode instance 😁.
1 parent 8b5b84a commit 5586475

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ def activate_matplotlib(enable_gui_function):
140140
if is_interactive:
141141
enable_gui_function(gui)
142142
if not matplotlib.is_interactive():
143-
sys.stdout.write("Backend %s is interactive backend. Turning interactive mode on.\n" % backend)
143+
sys.stderr.write("Backend %s is interactive backend. Turning interactive mode on.\n" % backend)
144144
matplotlib.interactive(True)
145145
else:
146146
if matplotlib.is_interactive():
147-
sys.stdout.write("Backend %s is non-interactive backend. Turning interactive mode off.\n" % backend)
147+
sys.stderr.write("Backend %s is non-interactive backend. Turning interactive mode off.\n" % backend)
148148
matplotlib.interactive(False)
149149
patch_use(enable_gui_function)
150150
patch_is_interactive()

0 commit comments

Comments
 (0)