diff options
author | Guido van Rossum <guido@python.org> | 1998-04-10 19:17:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-04-10 19:17:41 (GMT) |
commit | bd8341eeeb45b03effb2b511af699b635eb30a6c (patch) | |
tree | c4a4b29da800e3a05b2c4d53267d08e88d2910d6 /Demo/tkinter | |
parent | bd24eb447e398906a903de7c407f4afc9ec939d2 (diff) | |
download | cpython-bd8341eeeb45b03effb2b511af699b635eb30a6c.zip cpython-bd8341eeeb45b03effb2b511af699b635eb30a6c.tar.gz cpython-bd8341eeeb45b03effb2b511af699b635eb30a6c.tar.bz2 |
Catch exceptions in final self.destroy() call.
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-x | Demo/tkinter/guido/electrons.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py index d764380..f16c3fa 100755 --- a/Demo/tkinter/guido/electrons.py +++ b/Demo/tkinter/guido/electrons.py @@ -55,8 +55,11 @@ class Electrons: try: while 1: self.random_move(self.n) - finally: - self.tk.destroy() + except TclError: + try: + self.tk.destroy() + except TclError: + pass # Main program |