diff options
Diffstat (limited to 'Lib/turtledemo/minimal_hanoi.py')
-rwxr-xr-x | Lib/turtledemo/minimal_hanoi.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/turtledemo/minimal_hanoi.py b/Lib/turtledemo/minimal_hanoi.py index cfb78dc..5e9c27b 100755 --- a/Lib/turtledemo/minimal_hanoi.py +++ b/Lib/turtledemo/minimal_hanoi.py @@ -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 |