diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-22 17:26:35 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-22 17:26:35 +0200 |
commit | 4f38e483c2982dc5c304dc784d4094ab174d5be5 (patch) | |
tree | 0d054b2236de09036ff88a42362187b4bf01ac9c /Lib/turtledemo | |
parent | Issue #23152: Renames time_t_to_FILE_TIME to _Py_time_t_to_FILE_TIME, removes... (diff) | |
parent | Issue #6639: Module-level turtle functions no longer raise TclError after (diff) | |
download | cpython-4f38e483c2982dc5c304dc784d4094ab174d5be5.tar.gz cpython-4f38e483c2982dc5c304dc784d4094ab174d5be5.tar.bz2 cpython-4f38e483c2982dc5c304dc784d4094ab174d5be5.zip |
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__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index 6280c8497b6..106d0588089 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(): |