From bea159614231561f360b454acf9651bfcce0ca12 Mon Sep 17 00:00:00 2001 From: haosenwang1018 Date: Wed, 25 Feb 2026 07:07:06 +0000 Subject: [PATCH] fix: replace bare except with except Exception in enum __new__ The enum construction fallback should only catch standard exceptions, not KeyboardInterrupt or SystemExit. --- google/genai/_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/genai/_common.py b/google/genai/_common.py index f4a6984f7..42da9dc95 100644 --- a/google/genai/_common.py +++ b/google/genai/_common.py @@ -656,7 +656,7 @@ def _missing_(cls, value: Any) -> Any: unknown_enum_val._name_ = str(value) # pylint: disable=protected-access unknown_enum_val._value_ = value # pylint: disable=protected-access return unknown_enum_val - except: + except Exception: return None