File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
pgml-extension/src/bindings Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,13 @@ use crate::orm::*;
11
11
#[ macro_export]
12
12
macro_rules! create_pymodule {
13
13
( $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 ;
16
19
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, "" , "" )
18
21
. format_traceback( py) ?
19
22
. into( ) )
20
23
} )
You can’t perform that action at this time.
0 commit comments