Skip to content

Commit f123a55

Browse files
committed
Release GIL when waiting for a future
1 parent e98157f commit f123a55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pyfuture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl <F, T, U> Callback for FutureData<F, T>
4141

4242
fn wait(&mut self, py: Python) -> PyResult<PyObject> {
4343
let mut future = self.future.take().expect("Future already completed");
44-
let result = future.wait_future();
44+
let result = py.allow_threads(|| future.wait_future());
4545

4646
let then = self.then.take().unwrap();
4747
then(py, result).map(|o| o.into_py_object(py).into_object())

0 commit comments

Comments
 (0)