From 5b229f81497e5b47e495275df43ac5b53983b1b4 Mon Sep 17 00:00:00 2001 From: brnelson Date: Mon, 29 Jul 2024 21:43:29 +0000 Subject: [PATCH] Move default exception to end --- gpustat/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpustat/core.py b/gpustat/core.py index 87c3dc4..e0a2804 100644 --- a/gpustat/core.py +++ b/gpustat/core.py @@ -614,12 +614,12 @@ def _wrapped(*args, **kwargs): handle: NVMLHandle = N.nvmlDeviceGetHandleByIndex(index) gpu_info = get_gpu_info(handle) gpu_stat = GPUStat(gpu_info) - except Exception as e: - gpu_stat = InvalidGPU(index, "((Unknown Error))", e) except N.NVMLError_Unknown as e: gpu_stat = InvalidGPU(index, "((Unknown Error))", e) except N.NVMLError_GpuIsLost as e: gpu_stat = InvalidGPU(index, "((GPU is lost))", e) + except Exception as e: + gpu_stat = InvalidGPU(index, "((Unknown Error))", e) if isinstance(gpu_stat, InvalidGPU): log.add_exception("GPU %d" % index, gpu_stat.exception)