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

Skip to content

Commit d536b8e

Browse files
authored
Merge pull request #21601 from meeseeksmachine/auto-backport-of-pr-21530-on-v3.5.x
Backport PR #21530 on branch v3.5.x EE9B (Fix interrupting GTK on plain Python)
2 parents 7a4a366 + 632c41b commit d536b8e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/backends/_backend_gtk.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ def mainloop():
169169

170170
try:
171171
_application.run() # Quits when all added windows close.
172+
except KeyboardInterrupt:
173+
# Ensure all windows can process their close event from
174+
# _shutdown_application.
175+
context = GLib.MainContext.default()
176+
while context.pending():
177+
context.iteration(True)
178+
raise
172179
finally:
173180
# Running after quit is undefined, so create a new one next time.
174181
_application = None

0 commit comments

Comments
 (0)
0