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]
fn nac3artiq(_py: Python, m: &PyModule) -> PyResult<()> {
fn nac3artiq(py: Python, m: &PyModule) -> PyResult<()> {
#[cfg(feature = "init-llvm-profile")]
unsafe {
__llvm_profile_initialize();
}
Target::initialize_all(&InitializationConfig::default());
m.add("CompileError", py.get_type::<CompileError>())?;
m.add_class::<Nac3>()?;
Ok(())
}