Content-Length: 282865 | pFad | http://github.com/postgresml/postgresml/commit/d97e80dc0dcc2aa46da8aef77d7665bff28ef2ca

88 use fully qualified path in macro (#1011) · postgresml/postgresml@d97e80d · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgresml/postgresml/commit/d97e80dc0dcc2aa46da8aef77d7665bff28ef2ca

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy