mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #6639: Module-level turtle functions no longer raise TclError after
closing the window.
This commit is contained in:
parent
a3369a524c
commit
80a1803193
3 changed files with 39 additions and 33 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue