Skip to content

Commit f635d50

Browse files
author
Andrew J Westlake
committed
Attempting to fix some failed tests in PR
1 parent eb0870e commit f635d50

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/generic.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,17 @@ where
176176
let py = event_loop.py();
177177
let result_tx = Arc::new(Mutex::new(None));
178178
let result_rx = Arc::clone(&result_tx);
179-
let coro =
180-
future_into_py_with_locals::<R, _, ()>(py, TaskLocals::new(event_loop), async move {
179+
let coro = future_into_py_with_locals::<R, _, ()>(
180+
py,
181+
TaskLocals::new(event_loop).copy_context(py)?,
182+
async move {
181183
let val = fut.await?;
182184
if let Ok(mut result) = result_tx.lock() {
183185
*result = Some(val);
184186
}
185187
Ok(())
186-
})?;
188+
},
189+
)?;
187190

188191
event_loop.call_method1("run_until_complete", (coro,))?;
189192

0 commit comments

Comments
 (0)