[Mlir-commits] [mlir] 45e7b41 - [mlir:python] Fail immediately if importing an initializer module raises ImportError (#74595)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Dec 6 10:42:15 PST 2023


Author: Peter Hawkins
Date: 2023-12-06T12:42:11-06:00
New Revision: 45e7b410c0a19fd36c2264cdc3a1b4f2ab966790

URL: https://github.com/llvm/llvm-project/commit/45e7b410c0a19fd36c2264cdc3a1b4f2ab966790
DIFF: https://github.com/llvm/llvm-project/commit/45e7b410c0a19fd36c2264cdc3a1b4f2ab966790.diff

LOG: [mlir:python] Fail immediately if importing an initializer module raises ImportError (#74595)

Added: 
    

Modified: 
    mlir/python/mlir/_mlir_libs/__init__.py

Removed: 
    


################################################################################
diff  --git a/mlir/python/mlir/_mlir_libs/__init__.py b/mlir/python/mlir/_mlir_libs/__init__.py
index 32f46d24cc739..98dbbc6adf9ce 100644
--- a/mlir/python/mlir/_mlir_libs/__init__.py
+++ b/mlir/python/mlir/_mlir_libs/__init__.py
@@ -94,6 +94,7 @@ def process_initializer_module(module_name):
                 "encountered otherwise and the MLIR Python API may not function."
             )
             logger.warning(message, exc_info=True)
+            return False
 
         logger.debug("Initializing MLIR with module: %s", module_name)
         if hasattr(m, "register_dialects"):


        


More information about the Mlir-commits mailing list