Kaydet (Commit) dac44470 authored tarafından Guido van Rossum's avatar Guido van Rossum

Add try-finally around main loop.

üst 20abb4e6
...@@ -52,8 +52,11 @@ class Electrons: ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment