@@ -69,7 +69,7 @@ async fn main() -> PyResult<()> {
6969 let fut = Python :: with_gil (| py | {
7070 let asyncio = py . import (" asyncio" )? ;
7171 // convert asyncio.sleep into a Rust Future
72- pyo3_async_runtimes :: async_std :: into_future (asyncio . call_method1 (" sleep" , (1. into_py (py ),))? )
72+ pyo3_async_runtimes :: async_std :: into_future (asyncio . call_method1 (" sleep" , (1. into_pyobject (py ) . unwrap ( ),))? )
7373 })? ;
7474
7575 fut . await ? ;
@@ -99,7 +99,7 @@ async fn main() -> PyResult<()> {
9999 let fut = Python :: with_gil (| py | {
100100 let asyncio = py . import (" asyncio" )? ;
101101 // convert asyncio.sleep into a Rust Future
102- pyo3_async_runtimes :: tokio :: into_future (asyncio . call_method1 (" sleep" , (1. into_py (py ),))? )
102+ pyo3_async_runtimes :: tokio :: into_future (asyncio . call_method1 (" sleep" , (1. into_pyobject (py ) . unwrap ( ),))? )
103103 })? ;
104104
105105 fut . await ? ;
@@ -363,7 +363,7 @@ async fn main() -> PyResult<()> {
363363
364364 // convert asyncio.sleep into a Rust Future
365365 pyo3_async_runtimes :: async_std :: into_future (
366- asyncio . call_method1 (" sleep" , (1. into_py (py ),))?
366+ asyncio . call_method1 (" sleep" , (1. into_pyobject (py ) . unwrap ( ),))?
367367 )
368368 })? ;
369369
0 commit comments