Skip to content

Commit

Permalink
revert removal of _Py_XNewRef and _Py_NewRef in 0.22 line
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Sep 13, 2024
1 parent e90d793 commit 371593b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h
### Removed

- Remove private FFI definition `_Py_PackageContext`. [#4420](https://github.com/PyO3/pyo3/pull/4420)
- Remove private FFI definitions `_Py_NewRef` and `_Py_XNewRef`. [#4445](https://github.com/PyO3/pyo3/pull/4445)

### Fixed

Expand Down
1 change: 1 addition & 0 deletions newsfragments/4445.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove private FFI definitions `_Py_NewRef` and `_Py_XNewRef`.
6 changes: 4 additions & 2 deletions pyo3-ffi/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,10 @@ extern "C" {
pub fn Py_XNewRef(obj: *mut PyObject) -> *mut PyObject;
}

// macro _Py_NewRef not public; reimplemented directly inside Py_NewRef here
// macro _Py_XNewRef not public; reimplemented directly inside Py_XNewRef here
// 0.22.3 backwards-compatibility exports these private FFI definitions; they will be removed
// in 0.23.0
pub use crate::compat::Py_NewRef as _Py_NewRef;
pub use crate::compat::Py_XNewRef as _Py_XNewRef;

#[cfg(all(Py_3_10, any(not(Py_LIMITED_API), PyPy)))]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
Expand Down

0 comments on commit 371593b

Please sign in to comment.