nac3artiq: make CompileError importable from Python

This commit is contained in:
Sebastien Bourdeauducq 2022-02-26 17:29:13 +08:00
parent cbc77dddb0
commit 804d5db27e

View File

@ -797,13 +797,14 @@ extern "C" {
} }
#[pymodule] #[pymodule]
fn nac3artiq(_py: Python, m: &PyModule) -> PyResult<()> { fn nac3artiq(py: Python, m: &PyModule) -> PyResult<()> {
#[cfg(feature = "init-llvm-profile")] #[cfg(feature = "init-llvm-profile")]
unsafe { unsafe {
__llvm_profile_initialize(); __llvm_profile_initialize();
} }
Target::initialize_all(&InitializationConfig::default()); Target::initialize_all(&InitializationConfig::default());
m.add("CompileError", py.get_type::<CompileError>())?;
m.add_class::<Nac3>()?; m.add_class::<Nac3>()?;
Ok(()) Ok(())
} }