From 66f15729bee975a1ac30248e18192c66e139ccb2 Mon Sep 17 00:00:00 2001 From: Mark Harrison Date: Sun, 16 Nov 2025 00:55:36 -0800 Subject: [PATCH 1/2] Delete condition that is always False --- lib/lichess_bot.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/lichess_bot.py b/lib/lichess_bot.py index 769d598b2..8f4f20277 100644 --- a/lib/lichess_bot.py +++ b/lib/lichess_bot.py @@ -88,14 +88,11 @@ def disable_restart() -> None: def signal_handler(signal: int, frame: FrameType | None) -> None: # noqa: ARG001 """Terminate lichess-bot.""" - in_starting_thread = __name__ == "__main__" if not stop.terminated: - if in_starting_thread: - logger.debug("Received SIGINT. Terminating client.") + logger.debug("Received SIGINT. Terminating client.") stop.terminated = True else: - if in_starting_thread: - logger.debug("Received second SIGINT. Quitting now.") + logger.debug("Received second SIGINT. Quitting now.") stop.force_quit = True From c07dcf33387a25116aa697cc92297e397467d333 Mon Sep 17 00:00:00 2001 From: Mark Harrison Date: Mon, 1 Dec 2025 21:48:38 -0800 Subject: [PATCH 2/2] Remove terminated condition from API giveup --- lib/lichess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lichess.py b/lib/lichess.py index 1d8426ca5..c691736f5 100644 --- a/lib/lichess.py +++ b/lib/lichess.py @@ -105,7 +105,7 @@ def get_challenge_timeout(challenge_response: ChallengeType) -> datetime.timedel def is_final(exception: Exception) -> bool: """If `is_final` returns True then we won't retry.""" return (isinstance(exception, HTTPError) and exception.response is not None and exception.response.status_code < 500 - or stop.terminated or stop.force_quit) + or stop.force_quit) def backoff_handler(details: BackoffDetails) -> None: