@@ -111,7 +111,7 @@ impl PyRuntime {
111111
112112 let is_coroutine = unsafe { pyo3:: ffi:: PyCoro_CheckExact ( call_res. as_ptr ( ) ) == 1 } ;
113113 if is_coroutine {
114- let fut = pyo3_asyncio :: tokio:: into_future ( call_res. as_ref ( py) ) ?;
114+ let fut = pyo3_async_runtimes :: tokio:: into_future ( call_res. bind ( py) . clone ( ) ) ?;
115115 Ok ( PyScheduledFunResult :: Poll ( Box :: pin ( fut) ) )
116116 } else {
117117 Ok ( PyScheduledFunResult :: Ready ( CLRepr :: from_python_ref (
@@ -206,12 +206,12 @@ impl PyRuntime {
206206 trace ! ( "Initializing executor in a separate thread" ) ;
207207
208208 std:: thread:: spawn ( || {
209- pyo3_asyncio :: tokio:: get_runtime ( )
210- . block_on ( pyo3_asyncio :: tokio:: re_exports:: pending :: < ( ) > ( ) )
209+ pyo3_async_runtimes :: tokio:: get_runtime ( )
210+ . block_on ( pyo3_async_runtimes :: tokio:: re_exports:: pending :: < ( ) > ( ) )
211211 } ) ;
212212
213213 let res = Python :: with_gil ( |py| -> Result < ( ) , PyErr > {
214- pyo3_asyncio :: tokio:: run ( py, async move {
214+ pyo3_async_runtimes :: tokio:: run ( py, async move {
215215 loop {
216216 if let Some ( task) = receiver. recv ( ) . await {
217217 trace ! ( "New task" ) ;
@@ -247,7 +247,7 @@ pub fn py_runtime_init<'a, C: Context<'a>>(
247247
248248 pyo3:: prepare_freethreaded_python ( ) ;
249249 // it's safe to unwrap
250- pyo3_asyncio :: tokio:: init_with_runtime ( runtime) . unwrap ( ) ;
250+ pyo3_async_runtimes :: tokio:: init_with_runtime ( runtime) . unwrap ( ) ;
251251
252252 if PY_RUNTIME . set ( PyRuntime :: new ( channel) ) . is_err ( ) {
253253 cx. throw_error ( "Error on setting PyRuntime" )
0 commit comments