Skip to content

Commit 1286d43

Browse files
gh-70758: Fix creating a turtle screen after closing one (GH-30355)
Creating a new turtle screen after the previous one was closed no longer raises turtle.Terminator on the first turtle command. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 5107fd7 commit 1286d43

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/turtle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,9 @@ def __init__(self, cv, mode=_CFG["mode"],
10021002
rootwindow.wm_attributes(topmost=True)
10031003
rootwindow.wm_attributes(topmost=False)
10041004

1005+
# A new screen means that turtle graphics is running again.
1006+
TurtleScreen._RUNNING = True
1007+
10051008
def clear(self):
10061009
"""Delete all drawings and all turtles from the TurtleScreen.
10071010
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Creating a new :mod:`turtle` screen after the previous one was closed no
2+
longer raises ``turtle.Terminator`` on the first turtle command.

0 commit comments

Comments
 (0)