8000 Backport PR #21553 on branch v3.5.x (Fix check for manager presence in blocking_input.) by meeseeksmachine · Pull Request #21560 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #21553 on branch v3.5.x (Fix check for manager presence in blocking_input.) #21560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/_blocking_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def blocking_input_loop(figure, event_names, timeout, handler):
Function called for each event; it can force an early exit of the event
loop by calling ``canvas.stop_event_loop()``.
"""
if hasattr(figure.canvas, "manager"):
if figure.canvas.manager:
figure.show() # Ensure that the figure is shown if we are managing it.
# Connect the events to the on_event function call.
cids = [figure.canvas.mpl_connect(name, handler) for name in event_names]
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/blocking_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __call__(self, n=1, timeout=30):
self.n = n
self.events = []

if hasattr(self.fig.canvas, "manager"):
if self.figure.canvas.manager:
# Ensure that the figure is shown, if we are managing it.
self.fig.show()
# Connect the events to the on_event function call.
Expand Down
0