From 06aaa3213efa56c02346f0f64f75dae65628a365 Mon Sep 17 00:00:00 2001 From: liudonghua Date: Tue, 23 May 2023 15:21:52 +0800 Subject: [PATCH] Update life.py fix unhandled Terminator exception when close the game --- src/freegames/life.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freegames/life.py b/src/freegames/life.py index fcee86af..b8ea9570 100644 --- a/src/freegames/life.py +++ b/src/freegames/life.py @@ -58,7 +58,10 @@ def draw(): color = 'green' if alive else 'black' square(x, y, 10, color) update() - ontimer(draw, 100) + try: + ontimer(draw, 100) + except Terminator: + pass setup(420, 420, 370, 0)