From b58bc25043113789e83392ea30962376ed40c3c8 Mon Sep 17 00:00:00 2001 From: Frisk Date: Thu, 16 Jun 2022 23:06:25 +0200 Subject: [PATCH] Removed 3.7 incompatible type hints, added KeyboardInterrupt detection for exit code 0 --- src/discord/redaction.py | 2 +- src/rcgcdw.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/discord/redaction.py b/src/discord/redaction.py index 28c2575..8c70ae9 100644 --- a/src/discord/redaction.py +++ b/src/discord/redaction.py @@ -50,7 +50,7 @@ def delete_messages(matching_data: dict): db_connection.commit() -def redact_messages(ids: Union[List[Union[str, int]], set[Union[int, str]]], entry_type: int, to_censor: dict): +def redact_messages(ids, entry_type: int, to_censor: dict): # : Union[List[Union[str, int]], set[Union[int, str]]] """Redact past Discord messages ids: list of ints diff --git a/src/rcgcdw.py b/src/rcgcdw.py index 33e3eeb..51ee93e 100644 --- a/src/rcgcdw.py +++ b/src/rcgcdw.py @@ -344,4 +344,8 @@ if TESTING: while 1: time.sleep(1.0) - client.scheduler.run() + try: + client.scheduler.run() + except KeyboardInterrupt: + logger.info("Shutting down...") + break