summaryrefslogtreecommitdiffstats
path: root/Lib/turtledemo
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-22 15:26:35 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-22 15:26:35 (GMT)
commit4f38e483c2982dc5c304dc784d4094ab174d5be5 (patch)
tree0d054b2236de09036ff88a42362187b4bf01ac9c /Lib/turtledemo
parentbf1f376b3ead24b382ed9ad12b4a904116d5bc33 (diff)
parent80a1803193bcaef7a50324974117c3aa3fb0e48f (diff)
downloadcpython-4f38e483c2982dc5c304dc784d4094ab174d5be5.zip
cpython-4f38e483c2982dc5c304dc784d4094ab174d5be5.tar.gz
cpython-4f38e483c2982dc5c304dc784d4094ab174d5be5.tar.bz2
Issue #6639: Module-level turtle functions no longer raise TclError after
closing the window.
Diffstat (limited to 'Lib/turtledemo')
-rw-r--r--[-rwxr-xr-x]Lib/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..100644
--- 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():