Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce72670

Browse files
authored
Merge pull request #14632 from anntzer/tkwin
DOC: Remove reference to old Tk/Windows bug.
2 parents 66628cc + 5a18309 commit ce72670

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

examples/user_interfaces/embedding_in_tk_sgskip.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,7 @@ def on_key_press(event):
3939

4040
canvas.mpl_connect("key_press_event", on_key_press)
4141

42-
43-
def _quit():
44-
root.quit() # Stops mainloop.
45-
# The following is necessary on Windows to prevent
46-
# Fatal Python Error: PyEval_RestoreThread: NULL tstate
47-
root.destroy()
48-
49-
50-
button = tkinter.Button(master=root, text="Quit", command=_quit)
42+
button = tkinter.Button(master=root, text="Quit", command=root.quit)
5143
button.pack(side=tkinter.BOTTOM)
5244

5345
tkinter.mainloop()
54-
# If you put root.destroy() here, it will cause an error if the window is
55-
# closed with the window manager.

lib/matplotlib/backends/_backend_tk.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,6 @@ def resize(self, width, height):
465465
self.toolbar.configure(width=width)
466466

467467
def show(self):
468-
"""
469-
this function doesn't segfault but causes the
470-
PyEval_RestoreThread: NULL state bug on win32
471-
"""
472468
with _restore_foreground_window_at_end():
473469
if not self._shown:
474470
def destroy(*args):

0 commit comments

Comments
 (0)