diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-22 15:25:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-22 15:25:33 (GMT) |
commit | 80a1803193bcaef7a50324974117c3aa3fb0e48f (patch) | |
tree | 61be7ea1dd62d519596fd1eb7b8d918167aee7bb /Lib/turtledemo | |
parent | a3369a524c6f862936c1d8a24e23c796aa91f2c7 (diff) | |
download | cpython-80a1803193bcaef7a50324974117c3aa3fb0e48f.zip cpython-80a1803193bcaef7a50324974117c3aa3fb0e48f.tar.gz cpython-80a1803193bcaef7a50324974117c3aa3fb0e48f.tar.bz2 |
Issue #6639: Module-level turtle functions no longer raise TclError after
closing the window.
Diffstat (limited to 'Lib/turtledemo')
-rwxr-xr-x | Lib/turtledemo/__main__.py | 4 |
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(): |