From 4e4008cea93291b72b0785014e25746be747b2a6 Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Thu, 17 Sep 2026 15:43:46 -0400 Subject: [PATCH] lint(cost): justify blind except in _lookup_model_info_or_none get_model_info raises a bare Exception for unmapped models, so BLE001 cannot be narrowed; mark it noqa with the reason to stay within the strict budget. --- litellm/cost_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 6cb1ef8228e..352d95a4fdf 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -2170,7 +2170,7 @@ def ocr_batch_cost( def _lookup_model_info_or_none(model: str, custom_llm_provider: str | None) -> ModelInfo | None: try: return litellm.get_model_info(model=model, custom_llm_provider=custom_llm_provider) - except Exception: + except Exception: # noqa: BLE001 # get_model_info raises bare Exception for unmapped models; caller logs and bills 0.0 return None