Issue #6639: Module-level turtle functions no longer raise TclError after

closing the window.
This commit is contained in:
Serhiy Storchaka 2015-02-22 17:25:33 +02:00
parent a3369a524c
commit 80a1803193
3 changed files with 39 additions and 33 deletions

View file

@ -344,6 +344,8 @@ class DemoWindow(object):
else:
self.state = DONE
except turtle.Terminator:
if self.root is None:
return
self.state = DONE
result = "stopped!"
if self.state == DONE:
@ -369,7 +371,9 @@ class DemoWindow(object):
turtle.TurtleScreen._RUNNING = False
def _destroy(self):
turtle.TurtleScreen._RUNNING = False
self.root.destroy()
self.root = None
def main():