From b552bebe718dbd350b81e40f8b9a0b2c75bddc34 Mon Sep 17 00:00:00 2001 From: Aman Sachan Date: Tue, 5 May 2026 00:53:02 +0000 Subject: [PATCH] fix: replace bare except: with except Exception to avoid catching SystemExit/KeyboardInterrupt --- ExceptNotifier/pycore/discord_notifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ExceptNotifier/pycore/discord_notifier.py b/ExceptNotifier/pycore/discord_notifier.py index de22aab..0bf8022 100644 --- a/ExceptNotifier/pycore/discord_notifier.py +++ b/ExceptNotifier/pycore/discord_notifier.py @@ -65,7 +65,7 @@ def __call__(etype, value, tb): exceptNotifier["BODY"] += "\n\t%20s = " % key try: exceptNotifier["BODY"] += str(val) - except: + except Exception: exceptNotifier["BODY"] += "" print(exceptNotifier["BODY"]) @@ -121,7 +121,7 @@ def send_discord_msg(_DISCORD_WEBHOOK_URL: str, msg: str) -> dict: _DISCORD_WEBHOOK_URL, adapter=RequestsWebhookAdapter() ) resp = webhook.send(msg) - except: + except Exception: from discord import SyncWebhook webhook = SyncWebhook.from_url(_DISCORD_WEBHOOK_URL) # Initializing webhook