Skip to content

Commit 6c577a5

Browse files
miss-islingtonwilliamnavarajserhiy-storchaka
authored
[3.15] gh-70758: Fix creating a turtle screen after closing one (GH-30355) (GH-155449)
Creating a new turtle screen after the previous one was closed no longer raises turtle.Terminator on the first turtle command. (cherry picked from commit 1286d43) Co-authored-by: williamnavaraj <williamnavaraj@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent e6cb76d commit 6c577a5

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
@@ -953,6 +953,9 @@ def __init__(self, cv, mode=_CFG["mode"],
953953
rootwindow.wm_attributes(topmost=True)
954954
rootwindow.wm_attributes(topmost=False)
955955

956+
# A new screen means that turtle graphics is running again.
957+
TurtleScreen._RUNNING = True
958+
956959
def clear(self):
957960
"""Delete all drawings and all turtles from the TurtleScreen.
958961
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)