Skip to content

Commit af63f1c

Browse files
committed
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.
1 parent 037fcca commit af63f1c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3507,10 +3507,6 @@ def show(cls, *, block=None):
35073507
except AttributeError:
35083508
ipython_pylab = False
35093509
block = not ipython_pylab and not is_interactive()
3510-
# TODO: The above is a hack to get the WebAgg backend working with
3511-
# ipython's `%pylab` mode until proper integration is implemented.
3512-
if get_backend() == "WebAgg":
3513-
block = True
35143510
if block:
35153511
cls.mainloop()
35163512

0 commit comments

Comments
 (0)