Skip to content
Merged
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
6 changes: 4 additions & 2 deletions lib/matplotlib/backends/qt_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _exec(obj):


@contextlib.contextmanager
def _maybe_allow_interrupt(qapp):
def _maybe_allow_interrupt(qapp_or_eventloop):
"""
This manager allows to terminate a plot by sending a SIGINT. It is
necessary because the running Qt backend prevents Python interpreter to
Expand Down Expand Up @@ -215,7 +215,9 @@ def _may_clear_sock(*args):
def handle(*args):
nonlocal handler_args
handler_args = args
qapp.quit()
if hasattr(qapp_or_eventloop, 'closeAllWindows'):
qapp_or_eventloop.closeAllWindows()
qapp_or_eventloop.quit()

signal.signal(signal.SIGINT, handle)
try:
Expand Down