mirror of
https://github.com/python/cpython.git
synced 2025-11-08 21:52:45 +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
|
# Run -- never returns
|
||||||
def run(self):
|
def run(self):
|
||||||
|
try:
|
||||||
while 1:
|
while 1:
|
||||||
self.random_move(self.n)
|
self.random_move(self.n)
|
||||||
|
finally:
|
||||||
|
self.tk.destroy()
|
||||||
|
|
||||||
|
|
||||||
# Main program
|
# Main program
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue