From 8f4e58d29f7a3aed4099bc9e76c20845db709d9a Mon Sep 17 00:00:00 2001 From: Alan Li Date: Fri, 31 Jul 2026 22:33:14 -0400 Subject: [PATCH] Use specific exception types in CUDA version parse Per AGENTS.md: prefer specific exception types in new code. AttributeError covers torch.version.cuda being None, ValueError covers an unparseable version string. --- comfy/model_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 017df17d1..7dcfca35d 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -1966,7 +1966,7 @@ def supports_nvfp4_compute(device=None): # cuBLAS FP4 matmul kernels require CUDA 13+, see #11864 try: cuda_version_major = int(torch.version.cuda.split(".")[0]) - except: + except (AttributeError, ValueError): return False if cuda_version_major < 13: return False