Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works with PyPy.

Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works
with PyPy. Solves: "undefined symbol: PyObject_HasAttr" when
importing the library.
This commit is contained in:
Gert Hulselmans 2021-11-25 14:40:10 +01:00 committed by David Hewitt
parent 9990bf9d31
commit 5ecc715d10
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove `PyType::is_instance`, which is unintuitive; instead of `typ.is_instance(obj)`, use `obj.is_instance(typ)`. [#1985](https://github.com/PyO3/pyo3/pull/1985)
- Remove all functionality deprecated in PyO3 0.14. [#2007](https://github.com/PyO3/pyo3/pull/2007)
### Fixed
- Fix undefined symbol for `PyObject_HasAttr` on PyPy. [#2025](https://github.com/PyO3/pyo3/pull/2025)
## [0.15.1] - 2021-11-19
### Added

View File

@ -280,6 +280,7 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyObject_SetAttr")]
pub fn PyObject_SetAttr(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject)
-> c_int;
#[cfg_attr(PyPy, link_name = "PyPyObject_HasAttr")]
pub fn PyObject_HasAttr(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
#[cfg_attr(PyPy, link_name = "PyPyObject_SelfIter")]
pub fn PyObject_SelfIter(arg1: *mut PyObject) -> *mut PyObject;