From 5586475296a7e67dd29c7285438bf52af96bf650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ramos=20Carre=C3=B1o?= Date: Wed, 14 May 2025 19:15:55 +0200 Subject: [PATCH] Do not write to stdout on debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 😁. --- src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py b/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py index f1229ab6..ad91d543 100644 --- a/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py +++ b/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py @@ -140,11 +140,11 @@ def activate_matplotlib(enable_gui_function): if is_interactive: enable_gui_function(gui) if not matplotlib.is_interactive(): - sys.stdout.write("Backend %s is interactive backend. Turning interactive mode on.\n" % backend) + sys.stderr.write("Backend %s is interactive backend. Turning interactive mode on.\n" % backend) matplotlib.interactive(True) else: if matplotlib.is_interactive(): - sys.stdout.write("Backend %s is non-interactive backend. Turning interactive mode off.\n" % backend) + sys.stderr.write("Backend %s is non-interactive backend. Turning interactive mode off.\n" % backend) matplotlib.interactive(False) patch_use(enable_gui_function) patch_is_interactive()