mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 08:16:06 +00:00
[mlir][python] Fix possible use of variable use before set
The _mlirRegisterEverything symbol may not be built by some customers. The code here was intended to support this, but didn't properly initialize the init_module variable. This would break JAX with: NameError: free variable 'init_module' referenced before assignment in enclosing scope
This commit is contained in:
parent
a3ee0d4fac
commit
b2bdc45580
@ -83,6 +83,7 @@ def _site_initialize():
|
|||||||
|
|
||||||
# If _mlirRegisterEverything is built, then include it as an initializer
|
# If _mlirRegisterEverything is built, then include it as an initializer
|
||||||
# module.
|
# module.
|
||||||
|
init_module = None
|
||||||
if process_initializer_module("_mlirRegisterEverything"):
|
if process_initializer_module("_mlirRegisterEverything"):
|
||||||
init_module = importlib.import_module(f"._mlirRegisterEverything", __name__)
|
init_module = importlib.import_module(f"._mlirRegisterEverything", __name__)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user