From dac444703d1b7022bf3c2307af9232775bf6f2d9 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 14 Aug 1997 19:49:27 +0000 Subject: Add try-finally around main loop. --- Demo/tkinter/guido/electrons.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py index f3b8008..d764380 100755 --- a/Demo/tkinter/guido/electrons.py +++ b/Demo/tkinter/guido/electrons.py @@ -52,8 +52,11 @@ class Electrons: # Run -- never returns def run(self): - while 1: - self.random_move(self.n) + try: + while 1: + self.random_move(self.n) + finally: + self.tk.destroy() # Main program -- cgit v0.12