diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-07-23 21:27:57 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-07-23 21:27:57 (GMT) |
commit | b8352e7253e61e24f6ba3f06cda6135a3c976884 (patch) | |
tree | 13f4e4ae420da45ab8f8758336ad5366d4a21757 /Lib | |
parent | 88b2b45154c13947487fcdeca80f769092fb6890 (diff) | |
download | cpython-b8352e7253e61e24f6ba3f06cda6135a3c976884.zip cpython-b8352e7253e61e24f6ba3f06cda6135a3c976884.tar.gz cpython-b8352e7253e61e24f6ba3f06cda6135a3c976884.tar.bz2 |
Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/turtledemo/__main__.py | 26 |
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() |