diff options
author | Guido van Rossum <guido@python.org> | 1997-08-14 19:49:27 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-14 19:49:27 (GMT) |
commit | dac444703d1b7022bf3c2307af9232775bf6f2d9 (patch) | |
tree | d03c3caf90ed3c33b78e099d251d2729f2d8f31f /Demo/tkinter | |
parent | 20abb4e6b46873e19ff945763374af653f0f9192 (diff) | |
download | cpython-dac444703d1b7022bf3c2307af9232775bf6f2d9.zip cpython-dac444703d1b7022bf3c2307af9232775bf6f2d9.tar.gz cpython-dac444703d1b7022bf3c2307af9232775bf6f2d9.tar.bz2 |
Add try-finally around main loop.
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 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 |