From: Guido van Rossum Date: Thu, 14 Aug 1997 19:49:27 +0000 (+0000) Subject: Add try-finally around main loop. X-Git-Tag: v1.5a3~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dac444703d1b7022bf3c2307af9232775bf6f2d9;p=thirdparty%2FPython%2Fcpython.git Add try-finally around main loop. --- diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py index f3b80081d0eb..d7643804caab 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