mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Add try-finally around main loop.
This commit is contained in:
parent
20abb4e6b4
commit
dac444703d
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue