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

Skip to content

Commit bd8341e

Browse files
committed
Catch exceptions in final self.destroy() call.
1 parent bd24eb4 commit bd8341e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Demo/tkinter/guido/electrons.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ def run(self):
5555
try:
5656
while 1:
5757
self.random_move(self.n)
58-
finally:
59-
self.tk.destroy()
58+
except TclError:
59+
try:
60+
self.tk.destroy()
61+
except TclError:
62+
pass
6063

6164

6265
# Main program

0 commit comments

Comments
 (0)