|
93 | 93 | //! let locals = pyo3_async_runtimes::TaskLocals::with_running_loop(py)?.copy_context(py)?; |
94 | 94 | //! |
95 | 95 | //! // Convert the async move { } block to a Python awaitable |
96 | | -//! pyo3_async_runtimes::tokio::future_into_py_with_locals(py, locals.clone_ref(py), async move { |
| 96 | +//! pyo3_async_runtimes::tokio::future_into_py_with_locals(py, locals.clone_ref(), async move { |
97 | 97 | //! let py_sleep = Python::attach(|py| { |
98 | 98 | //! // Sometimes we need to call other async Python functions within |
99 | 99 | //! // this future. In order for this to work, we need to track the |
|
162 | 162 | //! |
163 | 163 | //! pyo3_async_runtimes::tokio::future_into_py_with_locals( |
164 | 164 | //! py, |
165 | | -//! locals.clone_ref(py), |
| 165 | +//! locals.clone_ref(), |
166 | 166 | //! // Store the current locals in task-local data |
167 | | -//! pyo3_async_runtimes::tokio::scope(locals.clone_ref(py), async move { |
| 167 | +//! pyo3_async_runtimes::tokio::scope(locals.clone_ref(), async move { |
168 | 168 | //! let py_sleep = Python::attach(|py| { |
169 | 169 | //! pyo3_async_runtimes::into_future_with_locals( |
170 | 170 | //! // Now we can get the current locals through task-local data |
|
189 | 189 | //! |
190 | 190 | //! pyo3_async_runtimes::tokio::future_into_py_with_locals( |
191 | 191 | //! py, |
192 | | -//! locals.clone_ref(py), |
| 192 | +//! locals.clone_ref(), |
193 | 193 | //! // Store the current locals in task-local data |
194 | | -//! pyo3_async_runtimes::tokio::scope(locals.clone_ref(py), async move { |
| 194 | +//! pyo3_async_runtimes::tokio::scope(locals.clone_ref(), async move { |
195 | 195 | //! let py_sleep = Python::attach(|py| { |
196 | 196 | //! pyo3_async_runtimes::into_future_with_locals( |
197 | 197 | //! &pyo3_async_runtimes::tokio::get_current_locals(py)?, |
|
0 commit comments