]> granicus.if.org Git - python/commitdiff
Catch exceptions in final self.destroy() call.
authorGuido van Rossum <guido@python.org>
Fri, 10 Apr 1998 19:17:41 +0000 (19:17 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 10 Apr 1998 19:17:41 +0000 (19:17 +0000)
Demo/tkinter/guido/electrons.py

index d7643804caab006f634ac5e20ce5acb801d6f59c..f16c3fa531d5aa61a3dbfd768f22b767c68f02ff 100755 (executable)
@@ -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