From efeb8753a7bd27b87f0770dbf259cc15a8fcfadf Mon Sep 17 00:00:00 2001 From: factnn <166481866+factnn@users.noreply.github.com> Date: Thu, 2 Jul 2026 22:03:21 +0800 Subject: [PATCH] fix: remove blind except Exception to fix BLE001 ruff --- litellm/utils.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index b58dc3758fd..48689653b33 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2379,15 +2379,12 @@ def _supports_factory( # azure/gpt-5.1_2025-11-13_global) that is not a registry key, # try the configured base_model as a fallback. if base_model is not None and base_model != model: - try: - _m, _p, _, _ = litellm.get_llm_provider( - model=base_model, custom_llm_provider=custom_llm_provider - ) - _info = _get_model_info_helper(model=_m, custom_llm_provider=_p) - if _info.get(key, False) is True: - return True - except Exception: - pass + _m, _p, _, _ = litellm.get_llm_provider( + model=base_model, custom_llm_provider=custom_llm_provider + ) + _info = _get_model_info_helper(model=_m, custom_llm_provider=_p) + if _info.get(key, False) is True: + return True return False except Exception as e: