From 20c78035ae1346ca6a60280af6ff9188df251612 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Thu, 18 Apr 2024 09:34:44 -0500 Subject: [PATCH] remove deprecated `py::new_pool` 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. --- binaries/runtime/src/operator/python.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/binaries/runtime/src/operator/python.rs b/binaries/runtime/src/operator/python.rs index f6c907ad6..448881705 100644 --- a/binaries/runtime/src/operator/python.rs +++ b/binaries/runtime/src/operator/python.rs @@ -186,17 +186,6 @@ pub fn run( let status = Python::with_gil(|py| -> Result { 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.