From a127cc83f89c249ff062be76124e54a05e2a31c6 Mon Sep 17 00:00:00 2001 From: Shuqiao Li Date: Fri, 18 Apr 2025 18:11:49 +0800 Subject: [PATCH] catch ImportError when C code not compiled (#575) ### What this PR does / why we need it? Found a problem when ImportError raised but not ModuleNotFoundError. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? CI passed Signed-off-by: Shuqiao Li --- vllm_ascend/device_allocator/camem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm_ascend/device_allocator/camem.py b/vllm_ascend/device_allocator/camem.py index f65c370..7cfb690 100644 --- a/vllm_ascend/device_allocator/camem.py +++ b/vllm_ascend/device_allocator/camem.py @@ -65,7 +65,7 @@ try: init_module, python_create_and_map, python_unmap_and_release) lib_name = find_loaded_library("vllm_ascend_C") camem_available = True -except ModuleNotFoundError as e: +except ImportError as e: logger.error("Failed to import vllm_ascend_C:%s", e) init_module = None python_create_and_map = None