8000 Merge pull request #21560 from meeseeksmachine/auto-backport-of-pr-21… · matplotlib/matplotlib@b41f8f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit b41f8f4

Browse files
authored
Merge pull request #21560 from meeseeksmachine/auto-backport-of-pr-21553-on-v3.5.x
Backport PR #21553 on branch v3.5.x (Fix check for manager presence in blocking_input.)
2 parents ed2b1d0 + 8fcd3b1 commit b41f8f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/_blocking_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def blocking_input_loop(figure, event_names, timeout, handler):
1818
Function called for each event; it can force an early exit of the event
1919
loop by calling ``canvas.stop_event_loop()``.
2020
"""
21-
if hasattr(figure.canvas, "manager"):
21+
if figure.canvas.manager:
2222
figure.show() # Ensure that the figure is shown if we are managing it.
2323
# Connect the events to the on_event function call.
2424
cids = [figure.canvas.mpl_connect(name, handler) for name in event_names]

lib/matplotlib/blocking_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __call__(self, n=1, timeout=30):
8383
self.n = n
8484
self.events = []
8585

86-
if hasattr(self.fig.canvas, "manager"):
86+
if self.figure.canvas.manager:
8787
# Ensure that the figure is shown, if we are managing it.
8888
self.fig.show()
8989
# Connect the events to the on_event function call.

0 commit comments

Comments
 (0)
0