mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: replace bare except clauses with except Exception
Bare `except:` catches BaseException including KeyboardInterrupt and SystemExit. Replaced 29 instances with `except Exception:`.
This commit is contained in:
@@ -208,7 +208,7 @@ class ChatGPTBot(Bot, OpenAIImage, OpenAICompatibleBot):
|
||||
try:
|
||||
os.remove(image_path)
|
||||
logger.debug(f"[CHATGPT] Removed temp image file: {image_path}")
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return Reply(ReplyType.TEXT, content)
|
||||
|
||||
Reference in New Issue
Block a user