Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0c603a6

Browse filesBrowse files
committed
Close all plot windows of a blocking show() on Ctrl+C
Addresses the Qt part of #23385. It appears that `qapp.quit()` does not automatically close the windows of the app. We therefore do it explicitly. A unit test for this would be quite complex. Test this by hand by Ctrl+C in an interactive shell.
1 parent 6501209 commit 0c603a6
Copy full SHA for 0c603a6

File tree

1 file changed

+2
-0
lines changed
Filter options

1 file changed

+2
-0
lines changed

‎lib/matplotlib/backends/qt_compat.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/qt_compat.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ def _may_clear_sock(*args):
215215
def handle(*args):
216216
nonlocal handler_args
217217
handler_args = args
218+
for window in qapp.allWindows():
219+
window.close()
218220
qapp.quit()
219221

220222
signal.signal(signal.SIGINT, handle)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.