We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a589856 + 73c0bd6 commit 07c0239Copy full SHA for 07c0239
lib/matplotlib/backends/qt_compat.py
@@ -163,7 +163,7 @@ def _exec(obj):
163
164
165
@contextlib.contextmanager
166
-def _maybe_allow_interrupt(qapp):
+def _maybe_allow_interrupt(qapp_or_eventloop):
167
"""
168
This manager allows to terminate a plot by sending a SIGINT. It is
169
necessary because the running Qt backend prevents Python interpreter to
@@ -215,7 +215,9 @@ def _may_clear_sock(*args):
215
def handle(*args):
216
nonlocal handler_args
217
handler_args = args
218
- qapp.quit()
+ if hasattr(qapp_or_eventloop, 'closeAllWindows'):
219
+ qapp_or_eventloop.closeAllWindows()
220
+ qapp_or_eventloop.quit()
221
222
signal.signal(signal.SIGINT, handle)
223
try:
0 commit comments