From 0d0089ea292760a8a3a3d5279ca0d6de74dcef6a Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Wed, 13 Apr 2022 09:02:45 +0200 Subject: [PATCH] Remove redundant use statements and add missing calls to add_function in datetime test. --- CHANGELOG.md | 2 +- pytests/src/datetime.rs | 2 ++ src/types/datetime.rs | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c060b1185..69633969b83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add an experimental `generate-abi3-import-lib` feature to auto-generate `python3.dll` import libraries for Windows. [#2282](https://github.com/PyO3/pyo3/pull/2282) - Add FFI definitions for `PyDateTime_BaseTime` and `PyDateTime_BaseDateTime`. [#2294](https://github.com/PyO3/pyo3/pull/2294) -- Added `PyTzInfoAccess`. [#2263](https://github.com/PyO3/pyo3/pull/2263) +- Added `PyTzInfoAccess` for safe access to time zone information. [#2263](https://github.com/PyO3/pyo3/pull/2263) ### Changed diff --git a/pytests/src/datetime.rs b/pytests/src/datetime.rs index fc67b24718b..b21d3e6931b 100644 --- a/pytests/src/datetime.rs +++ b/pytests/src/datetime.rs @@ -224,6 +224,8 @@ pub fn datetime(_py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(make_datetime, m)?)?; m.add_function(wrap_pyfunction!(get_datetime_tuple, m)?)?; m.add_function(wrap_pyfunction!(datetime_from_timestamp, m)?)?; + m.add_function(wrap_pyfunction!(get_datetime_tzinfo, m)?)?; + m.add_function(wrap_pyfunction!(get_time_tzinfo, m)?)?; // Functions not supported by PyPy #[cfg(not(PyPy))] diff --git a/src/types/datetime.rs b/src/types/datetime.rs index 68eaa82980d..907827744c5 100644 --- a/src/types/datetime.rs +++ b/src/types/datetime.rs @@ -4,11 +4,8 @@ //! documentation](https://docs.python.org/3/library/datetime.html) use crate::err::PyResult; -use crate::ffi; -#[cfg(PyPy)] -use crate::ffi::datetime::{PyDateTime_FromTimestamp, PyDate_FromTimestamp}; use crate::ffi::{ - PyDateTime_CAPI, PyDateTime_FromTimestamp, PyDateTime_IMPORT, PyDate_FromTimestamp, + self, PyDateTime_CAPI, PyDateTime_FromTimestamp, PyDateTime_IMPORT, PyDate_FromTimestamp, }; #[cfg(not(PyPy))] use crate::ffi::{PyDateTime_DATE_GET_FOLD, PyDateTime_TIME_GET_FOLD};