From 1cefc7bdcbd00b829a03dc207c04a7143b8403ec Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Sat, 23 Oct 2021 14:04:45 -0700 Subject: [PATCH] ffi: restore _PyImport_FindExtensionObject on Python 3.10 This symbol was initially removed from 3.10. But it was restored late in the 3.10 development cycle in time for 3.10.0. See https://bugs.python.org/issue45307. --- CHANGELOG.md | 1 + src/ffi/cpython/import.rs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8755fcb2bf8..fd04fcdc519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Move Py_DecodeLocale from sysmodule to fileutils. [#1887](https://github.com/PyO3/pyo3/pull/1887) - Deprecate `PySys_AddWarnOption`, `PySys_AddWarnOptionUnicode` and `PySys_HasWarnOptions`. [#1887](https://github.com/PyO3/pyo3/pull/1887) - Remove function PyTuple_ClearFreeList from python 3.9 above. [#1887](https://github.com/PyO3/pyo3/pull/1887) +- The `_PyImport_FindExtensionObject` FFI binding is now available to Python 3.10. The symbol is not present in some 3.10 release candidates but is present in the final release. [#1942](https://github.com/PyO3/pyo3/pull/1942) ### Fixed diff --git a/src/ffi/cpython/import.rs b/src/ffi/cpython/import.rs index 05279f19d34..6fc7d35829e 100644 --- a/src/ffi/cpython/import.rs +++ b/src/ffi/cpython/import.rs @@ -16,7 +16,6 @@ extern "C" { pub fn _PyImport_FindBuiltin(name: *const c_char) -> *mut PyObject; #[cfg(all(Py_3_7, not(Py_3_9)))] pub fn _PyImport_FindBuiltin(name: *const c_char, modules: *mut PyObject) -> *mut PyObject; - #[cfg(not(Py_3_10))] pub fn _PyImport_FindExtensionObject(a: *mut PyObject, b: *mut PyObject) -> *mut PyObject; #[cfg(not(Py_3_7))] pub fn _PyImport_FixupBuiltin(module: *mut PyObject, name: *const c_char) -> c_int;