Skip to content

Commit 9f0d899

Browse files
committed
fixes
1 parent 72489bb commit 9f0d899

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/async_std.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ where
512512
/// Python::with_gil(|py| {
513513
/// pyo3_async_runtimes::async_std::into_future(
514514
/// test_mod
515-
/// .call_method1(py, "py_sleep", (seconds.into_py(py),))?
515+
/// .call_method1(py, "py_sleep", (seconds.into_pyobject(py).unwrap(),))?
516516
/// .into_bound(py),
517517
/// )
518518
/// })?
@@ -539,6 +539,7 @@ pub fn into_future(
539539
/// ```
540540
/// use pyo3::prelude::*;
541541
/// use futures::{StreamExt, TryStreamExt};
542+
/// use std::ffi::CString;
542543
///
543544
/// const TEST_MOD: &str = r#"
544545
/// import asyncio

src/generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ fn set_result(
457457
/// Python::with_gil(|py| {
458458
/// pyo3_async_runtimes::generic::into_future::<MyCustomRuntime>(
459459
/// test_mod
460-
/// .call_method1(py, "py_sleep", (seconds.into_py(py),))?
460+
/// .call_method1(py, "py_sleep", (seconds.into_pyobject(py).unwrap(),))?
461461
/// .into_bound(py),
462462
/// )
463463
/// })?

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ fn call_soon_threadsafe<'py>(
605605
///
606606
/// ```
607607
/// use std::time::Duration;
608+
/// use std::ffi::CString;
608609
///
609610
/// use pyo3::prelude::*;
610611
///
@@ -633,7 +634,7 @@ fn call_soon_threadsafe<'py>(
633634
/// pyo3_async_runtimes::into_future_with_locals(
634635
/// &pyo3_async_runtimes::tokio::get_current_locals(py)?,
635636
/// test_mod
636-
/// .call_method1(py, "py_sleep", (seconds.into_py(py),))?
637+
/// .call_method1(py, "py_sleep", (seconds.into_pyobject(py).unwrap(),))?
637638
/// .into_bound(py),
638639
/// )
639640
/// })?

src/tokio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ where
586586
/// Python::with_gil(|py| {
587587
/// pyo3_async_runtimes::tokio::into_future(
588588
/// test_mod
589-
/// .call_method1(py, "py_sleep", (seconds.into_py(py),))?
589+
/// .call_method1(py, "py_sleep", (seconds.into_pyobject(py).unwrap(),))?
590590
/// .into_bound(py),
591591
/// )
592592
/// })?

0 commit comments

Comments
 (0)