summaryrefslogtreecommitdiffstats
path: root/Lib/turtledemo/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/turtledemo/__main__.py')
-rwxr-xr-xLib/turtledemo/__main__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py
index 6280c84..106d058 100755
--- a/Lib/turtledemo/__main__.py
+++ b/Lib/turtledemo/__main__.py
@@ -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():