From 3e87ea3593e0b99849302901951f204e5d13aae6 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Tue, 25 May 2021 11:00:20 +0100 Subject: [PATCH] pymodule: don't call PyEval_InitThreads --- CHANGELOG.md | 1 + src/derive_utils.rs | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 581d5906..7b3a8975 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Deprecate `#[name = "..."]` attributes in favor of `#[pyo3(name = "...")]`. [#1567](https://github.com/PyO3/pyo3/pull/1567) - Reduce LLVM line counts to improve compilation times. [#1604](https://github.com/PyO3/pyo3/pull/1604) - Deprecate string-literal second argument to `#[pyfn(m, "name")]`. [#1610](https://github.com/PyO3/pyo3/pull/1610) +- No longer call `PyEval_InitThreads()` in `#[pymodule]` init code. [#1630](https://github.com/PyO3/pyo3/pull/1630) ### Removed - Remove deprecated exception names `BaseException` etc. [#1426](https://github.com/PyO3/pyo3/pull/1426) diff --git a/src/derive_utils.rs b/src/derive_utils.rs index adc2a80b..1e68b608 100644 --- a/src/derive_utils.rs +++ b/src/derive_utils.rs @@ -315,12 +315,6 @@ impl ModuleDef { py: Python, initializer: impl Fn(Python, &PyModule) -> PyResult<()>, ) -> PyResult<*mut ffi::PyObject> { - #[cfg(py_sys_config = "WITH_THREAD")] - // > Changed in version 3.7: This function is now called by Py_Initialize(), so you don’t have - // > to call it yourself anymore. - #[cfg(not(Py_3_7))] - ffi::PyEval_InitThreads(); - let module = unsafe { py.from_owned_ptr_or_err::(ffi::PyModule_Create(self.0.get()))? }; initializer(py, module)?;