Skip to content

Commit 962c041

Browse files
committed
rustpython cleanup
1 parent fad8da6 commit 962c041

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::sync::mpsc as std_mpsc;
1717
use std::thread;
1818
use thiserror::Error;
1919
use tokio::sync::{mpsc, oneshot};
20-
use tokio::runtime::{Builder, Runtime};
20+
use tokio::runtime::Runtime;
2121

2222
#[derive(Debug)]
2323
pub(crate) enum CmdType {
@@ -110,14 +110,14 @@ impl PyRunner {
110110
thread::spawn(move || {
111111
#[cfg(all(feature = "pyo3", not(feature = "rustpython")))]
112112
{
113+
use tokio::runtime::Builder;
113114
let rt = Builder::new_multi_thread().enable_all().build().unwrap();
114115
rt.block_on(pyo3_runner::python_thread_main(receiver));
115116
}
116117

117118
#[cfg(feature = "rustpython")]
118119
{
119-
let rt = Builder::new_current_thread().enable_all().build().unwrap();
120-
rt.block_on(rustpython_runner::python_thread_main(receiver));
120+
rustpython_runner::python_thread_main(receiver);
121121
}
122122
});
123123

@@ -291,7 +291,6 @@ impl PyRunner {
291291
/// * `args`: A vector of `serde_json::Value` to pass as arguments to the function.
292292
///
293293
/// **Note:** This function is safe to call from any context (sync or async).
294-
#[cfg(feature = "pyo3")]
295294
pub fn call_function_sync(
296295
&self,
297296
name: &str,

src/rustpython_runner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub(crate) fn python_thread_main(mut receiver: mpsc::Receiver<PyCommand>) {
4848
.and_then(|obj| py_to_json(vm, &obj))
4949
}
5050
CmdType::CallAsyncFunction { name, args } => {
51+
dbg!(name, args);
5152
unimplemented!("Async functions are not supported yet in RustPython")
5253
}
5354
CmdType::Stop => break,

0 commit comments

Comments
 (0)