Issue #21823: Catch turtle.Terminator exceptions in turtledemo.

Add note to demohelp.txt about doing so.
This commit is contained in:
Terry Jan Reedy 2014-06-22 01:18:54 -04:00
parent fabefc3c5b
commit f51531e257
3 changed files with 37 additions and 25 deletions

View file

@ -18,6 +18,7 @@ stretched to rectangles by shapesize()
---------------------------------------
"""
from turtle import *
from turtle import Terminator # not in __all__
class Disc(Turtle):
def __init__(self, n):
@ -50,9 +51,12 @@ def hanoi(n, from_, with_, to_):
def play():
onkey(None,"space")
clear()
hanoi(6, t1, t2, t3)
write("press STOP button to exit",
align="center", font=("Courier", 16, "bold"))
try:
hanoi(6, t1, t2, t3)
write("press STOP button to exit",
align="center", font=("Courier", 16, "bold"))
except Terminator:
pass # turtledemo user pressed STOP
def main():
global t1, t2, t3