Skip to content

Commit 380ed1f

Browse files
committed
removing pyo3::prepare_freethreaded_python()
1 parent de5cb78 commit 380ed1f

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ links = "tauri-plugin-python"
1212
tauri = { version = "2.1.0" }
1313
serde = "1.0"
1414
thiserror = "2"
15-
pyo3 = "0.23.3"
15+
pyo3 = { version = "0.23.3", features=["auto-initialize"] }
1616
lazy_static = "1.5.0"
1717

1818
[build-dependencies]

src/py_lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ lazy_static! {
2222
Mutex::new(marker::Python::with_gil(|py| { PyDict::new(py).into() }));
2323
}
2424
pub fn init_python() -> PyResult<()> {
25-
pyo3::prepare_freethreaded_python();
2625
let code = py_main_import::read_at_startup();
27-
let c_code = CString::new(code).expect("error loading python");
26+
let c_code = CString::new(code).expect("error creating cstring from code");
2827
marker::Python::with_gil(|py| -> PyResult<()> {
2928
let syspath = py
3029
.import("sys")?

0 commit comments

Comments
 (0)