From d414b19e37e0267cd7f4d25099791fcf4e97a45f Mon Sep 17 00:00:00 2001 From: leavesster <11785335+leavesster@users.noreply.github.com> Date: Fri, 30 Jan 2026 23:59:38 +0800 Subject: [PATCH] fix: replace bare except with specific exception types Bare except catches KeyboardInterrupt and SystemExit, preventing normal program termination. Now only catches KeyError, TypeError, ValueError which are the actual exceptions StoreKey.__init__ may raise. --- executor/python_executor/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor/python_executor/context.py b/executor/python_executor/context.py index 6220399..5eb767d 100644 --- a/executor/python_executor/context.py +++ b/executor/python_executor/context.py @@ -36,7 +36,7 @@ def createContext( wrap_var: VarValueDict = v try: ref = StoreKey(**wrap_var["value"]) - except: # noqa: E722 + except (KeyError, TypeError, ValueError): logger.warning(f"not valid object ref: {wrap_var}") continue if ref in store: