summaryrefslogtreecommitdiffstats
path: root/Lib/turtledemo
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/turtledemo')
-rwxr-xr-xLib/turtledemo/__main__.py26
1 files changed, 5 insertions, 21 deletions
diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py
index 35b1651..0c151a3 100755
--- a/Lib/turtledemo/__main__.py
+++ b/Lib/turtledemo/__main__.py
@@ -252,27 +252,11 @@ class DemoWindow(object):
def _destroy(self):
self.root.destroy()
- sys.exit()
-if __name__ == '__main__':
+def main():
demo = DemoWindow()
- RUN = True
- while RUN:
- try:
- #print("ENTERING mainloop")
- demo.root.mainloop()
- except AttributeError:
- #print("AttributeError!- WAIT A MOMENT!")
- time.sleep(0.3)
- print("GOING ON ..")
- demo.ckearCanvas()
- except TypeError:
- demo.screen._delete("all")
- #print("CRASH!!!- WAIT A MOMENT!")
- time.sleep(0.3)
- #print("GOING ON ..")
- demo.clearCanvas()
- except:
- print("BYE!")
- RUN = False
+ demo.root.mainloop()
+
+if __name__ == '__main__':
+ main()