From af63f1cfbc65be4b8b0018d0178f52f353059072 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 22 May 2022 19:12:33 +0200 Subject: [PATCH] Remove unneeded cutout for webagg in show(). _Backend.show() is used to generate a backend_module.show() method (by wrapping _Backend.mainloop() with some boilerplate), which is then what pyplot.show() calls. Currently, it contains a cutout for webagg (wrt. `block` support), but that's not really needed: the webagg backend defines a show() function *directly*, without going through the mainloop helper (this was the case even before the introduction of the _Backend helper in 5141f80), and thus the `if get_backend() == "WebAgg"` check is never reached when using webagg (try adding a print there and running `MPLBACKEND=webagg python -c 'from pylab import *; plot(); show()'`). So we can just remove the cutout. --- lib/matplotlib/backend_bases.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index f70be0d91b94..4fc6ca82125d 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -3507,10 +3507,6 @@ def show(cls, *, block=None): except AttributeError: ipython_pylab = False block = not ipython_pylab and not is_interactive() - # TODO: The above is a hack to get the WebAgg backend working with - # ipython's `%pylab` mode until proper integration is implemented. - if get_backend() == "WebAgg": - block = True if block: cls.mainloop()