Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffi: small corrections #2421

Merged
merged 2 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix "raw-ident" structs (e.g. `#[pyclass] struct r#RawName`) incorrectly having `r#` at the start of the class name created in Python. [#2395](https://github.com/PyO3/pyo3/pull/2395)
- Fix case where `ValueError` without message could be raised by the `#[derive(FromPyObject)]` generated implementation for a tuple struct. [#2414](https://github.com/PyO3/pyo3/pull/2414)
- Fix compile failure when using `#[pyo3(from_py_with = "pouf")]` in on a field in a `#[derive(FromPyObject)]` struct. [#2414](https://github.com/PyO3/pyo3/pull/2414)
- Fix FFI definitions `_PyDateTime_BaseTime` lacking leading underscores in their names. [#2421](https://github.com/PyO3/pyo3/pull/2421)
- Remove FFI definition `PyArena` on Python 3.10 and up. [#2421](https://github.com/PyO3/pyo3/pull/2421)

## [0.16.5] - 2022-05-15

Expand Down
8 changes: 4 additions & 4 deletions pyo3-ffi/src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct PyDateTime_Delta {
#[repr(C)]
#[derive(Debug, Copy, Clone)]
/// Structure representing a `datetime.time` without a `tzinfo` member.
pub struct PyDateTime_BaseTime {
pub struct _PyDateTime_BaseTime {
pub ob_base: PyObject,
#[cfg(not(PyPy))]
pub hashcode: Py_hash_t,
Expand All @@ -60,7 +60,7 @@ pub struct PyDateTime_BaseTime {
/// # Safety
///
/// Care should be taken when reading the `tzinfo` field of this type. If the time does not have a
/// tzinfo then the Python interpreter is free to allocate it as a [PyDateTime_BaseTime].
/// tzinfo then the Python interpreter is free to allocate it as a [_PyDateTime_BaseTime].
pub struct PyDateTime_Time {
pub ob_base: PyObject,
#[cfg(not(PyPy))]
Expand All @@ -87,7 +87,7 @@ pub struct PyDateTime_Date {
#[repr(C)]
#[derive(Debug, Copy, Clone)]
/// Structure representing a `datetime.datetime` without a `tzinfo` member.
pub struct PyDateTime_BaseDateTime {
pub struct _PyDateTime_BaseDateTime {
pub ob_base: PyObject,
#[cfg(not(PyPy))]
pub hashcode: Py_hash_t,
Expand All @@ -105,7 +105,7 @@ pub struct PyDateTime_BaseDateTime {
/// # Safety
///
/// Care should be taken when reading the `tzinfo` field of this type. If the datetime does not have a
/// tzinfo then the Python interpreter is free to allocate it as a [PyDateTime_BaseDateTime].
/// tzinfo then the Python interpreter is free to allocate it as a [_PyDateTime_BaseDateTime].
pub struct PyDateTime_DateTime {
pub ob_base: PyObject,
#[cfg(not(PyPy))]
Expand Down
4 changes: 2 additions & 2 deletions pyo3-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub use self::moduleobject::*;
pub use self::object::*;
pub use self::objimpl::*;
pub use self::osmodule::*;
#[cfg(not(Py_LIMITED_API))]
#[cfg(not(any(Py_LIMITED_API, Py_3_10)))]
pub use self::pyarena::*;
pub use self::pycapsule::*;
pub use self::pyerrors::*;
Expand Down Expand Up @@ -399,7 +399,7 @@ mod osmodule;
// skipped picklebufobject.h
// skipped pyctype.h
// skipped py_curses.h
#[cfg(not(Py_LIMITED_API))]
#[cfg(not(any(Py_LIMITED_API, Py_3_10)))]
mod pyarena;
mod pycapsule;
// skipped pydecimal.h
Expand Down
2 changes: 1 addition & 1 deletion src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ mod negative_impls {
impl !Ungil for crate::ffi::PyCodeObject {}
#[cfg(not(Py_LIMITED_API))]
impl !Ungil for crate::ffi::PyDictKeysObject {}
#[cfg(not(Py_LIMITED_API))]
#[cfg(not(any(Py_LIMITED_API, Py_3_10)))]
impl !Ungil for crate::ffi::PyArena {}
}

Expand Down