From 21b0ed2d4e5c71a8ee445c775251824276fb0cd6 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Thu, 2 Jun 2022 09:27:19 +0100 Subject: [PATCH] ffi: fix names of _Base datetime structs --- CHANGELOG.md | 1 + pyo3-ffi/src/datetime.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 402e4d42e48..1c38aef5c64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed incorrectly disabled FFI definition `PyThreadState_DeleteCurrent`. [#2357](https://github.com/PyO3/pyo3/pull/2357) - Correct FFI definition `PyEval_EvalCodeEx` to take `*const *mut PyObject` array arguments instead of `*mut *mut PyObject` (this was changed in CPython 3.6). [#2368](https://github.com/PyO3/pyo3/pull/2368) - 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 FFI definitions `_PyDateTime_BaseTime` lacking leading underscores in their names. [#2421](https://github.com/PyO3/pyo3/pull/2421) ## [0.16.5] - 2022-05-15 diff --git a/pyo3-ffi/src/datetime.rs b/pyo3-ffi/src/datetime.rs index 74f83bbf941..166a8f314b8 100644 --- a/pyo3-ffi/src/datetime.rs +++ b/pyo3-ffi/src/datetime.rs @@ -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, @@ -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))] @@ -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, @@ -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))]