We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent5b80748 commit30156d9Copy full SHA for 30156d9
pgml-extension/src/bindings/mod.rs
@@ -11,10 +11,13 @@ use crate::orm::*;
11
#[macro_export]
12
macro_rules! create_pymodule{
13
($pyfile:literal) =>{
14
-pubstaticPY_MODULE:Lazy<anyhow::Result<Py<PyModule>>> =Lazy::new(||{
15
-Python::with_gil(|py| -> anyhow::Result<Py<PyModule>>{
+pubstaticPY_MODULE: once_cell::sync::Lazy<
+ 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;
19
let src = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), $pyfile));
-Ok(PyModule::from_code(py, src,"","")
20
+Ok(pyo3::types::PyModule::from_code(py, src,"","")
21
.format_traceback(py)?
22
.into())
23
})