Skip to content

Commit d97e80d

Browse files
authored
use fully qualified path in macro (#1011)
1 parent 1fc58b8 commit d97e80d

File tree

1 file changed

+6
-3
lines changed
  • pgml-extension/src/bindings

1 file changed

+6
-3
lines changed

pgml-extension/src/bindings/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ use crate::orm::*;
1111
#[macro_export]
1212
macro_rules! create_pymodule {
1313
($pyfile:literal) => {
14-
pub static PY_MODULE: Lazy<anyhow::Result<Py<PyModule>>> = Lazy::new(|| {
15-
Python::with_gil(|py| -> anyhow::Result<Py<PyModule>> {
14+
pub static PY_MODULE: once_cell::sync::Lazy<
15+
anyhow::Result<pyo3::Py<pyo3::types::PyModule>>,
16+
> = once_cell::sync::Lazy::new(|| {
17+
pyo3::Python::with_gil(|py| -> anyhow::Result<pyo3::Py<pyo3::types::PyModule>> {
18+
use $crate::bindings::TracebackError;
1619
let src = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), $pyfile));
17-
Ok(PyModule::from_code(py, src, "", "")
20+
Ok(pyo3::types::PyModule::from_code(py, src, "", "")
1821
.format_traceback(py)?
1922
.into())
2023
})

0 commit comments

Comments
 (0)