File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use std::sync::mpsc as std_mpsc;
1717use std:: thread;
1818use thiserror:: Error ;
1919use tokio:: sync:: { mpsc, oneshot} ;
20- use tokio:: runtime:: { Builder , Runtime } ;
20+ use tokio:: runtime:: Runtime ;
2121
2222#[ derive( Debug ) ]
2323pub ( 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 ,
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments