From c26299fd0e87ec6a2fe241e80a44f4d7614f7b4c Mon Sep 17 00:00:00 2001 From: xereeto Date: Sat, 9 Mar 2024 18:06:53 +0000 Subject: [PATCH] fixed ctrl-c bug --- wordle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wordle.py b/wordle.py index e567c9e..72ce39c 100644 --- a/wordle.py +++ b/wordle.py @@ -215,14 +215,16 @@ def main(): import sys +w=None try: w=main() + except KeyboardInterrupt: pass finally: print("\033cGoodbye!"+reset,end='') cliflag = sys.argv[1] if len(sys.argv) > 1 else '' - if(cliflag != "--no-unicode"): + if(w and cliflag != "--nounicode"): print("\n\nWordle "+str(w.turn)+"/6") blocks=["⬛","🟨","🟩"] for guess in w.guesses: