Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
XmchxUp committed Nov 29, 2024
1 parent b82622d commit 8fa405c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bindings/python/src/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@ impl AsyncLister {
let mut lister = lister.lock().await;
let entry = lister.try_next().await.map_err(format_pyerr)?;
match entry {
Some(entry) => Ok(Python::with_gil(|py| Entry::new(entry).into_py(py))),
Some(entry) => Python::with_gil(|py| {
let py_obj = Entry::new(entry).into_pyobject(py)?.into_any().unbind();
Ok(Some(py_obj))
}),
None => Err(PyStopAsyncIteration::new_err("stream exhausted")),
}
})?;
Ok(Some(fut.into()))
});

match fut {
Ok(fut) => Ok(Some(fut.into())),
Err(e) => Err(e),
}
}
}

0 comments on commit 8fa405c

Please sign in to comment.