Skip to content

Commit

Permalink
remove deprecated py::new_pool
Browse files Browse the repository at this point in the history
The deprecation warning states:

> code not using the `GIL Refs` API can safely remove the use of `Py::new_pool`

All GIL Refs usage have been removed, so this should be fine.
  • Loading branch information
Michael-J-Ward committed Apr 18, 2024
1 parent a62eeca commit 20c7803
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions binaries/runtime/src/operator/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,6 @@ pub fn run(
let status = Python::with_gil(|py| -> Result<i32> {
let span = span!(tracing::Level::TRACE, "on_event", input_id = field::Empty);
let _ = span.enter();
// We need to create a new scoped `GILPool` because the dora-runtime
// is currently started through a `start_runtime` wrapper function,
// which is annotated with `#[pyfunction]`. This attribute creates an
// initial `GILPool` that lasts for the entire lifetime of the `dora-runtime`.
// However, we want the `PyBytes` created below to be freed earlier.
// creating a new scoped `GILPool` tied to this closure, will free `PyBytes`
// at the end of the closure.
// See https://github.com/PyO3/pyo3/pull/2864 and
// https://github.com/PyO3/pyo3/issues/2853 for more details.
let pool = unsafe { py.new_pool() };
let py = pool.python();

// Add metadata context if we have a tracer and
// incoming input has some metadata.
Expand Down

0 comments on commit 20c7803

Please sign in to comment.