8000 Backport PR #12707: Fix tk error when closing first pyplot figure (#1… · matplotlib/matplotlib@1cad07e · GitHub
[go: up one dir, main page]

Skip to content

Commit 1cad07e

Browse files
meeseeksmachinetimhoffm
authored andcommitted
Backport PR #12707: Fix tk error when closing first pyplot figure (#12732)
1 parent 2aede99 commit 1cad07e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,4 +1034,6 @@ def trigger_manager_draw(manager):
10341034

10351035
@staticmethod
10361036
def mainloop():
1037-
Tk.mainloop()
1037+
managers = Gcf.get_all_fig_managers()
1038+
if managers:
1039+
managers[0].window.mainloop()

0 commit comments

Comments
 (0)
0