From abd8e77ad861a75a149cff488cc2949bc760f0f5 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Wed, 31 Jan 2024 18:09:49 +0800 Subject: [PATCH] [extension] fixed exception catch (#5342) --- extensions/cpp_extension.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cpp_extension.py b/extensions/cpp_extension.py index b4c40c9f1..3adb65fb8 100644 --- a/extensions/cpp_extension.py +++ b/extensions/cpp_extension.py @@ -126,7 +126,7 @@ class _CppExtension(_Extension): def load(self): try: op_kernel = self.import_op() - except ImportError: + except (ImportError, ModuleNotFoundError): # if import error occurs, it means that the kernel is not pre-built # so we build it jit op_kernel = self.build_jit()