From db58eede5c45a83827e85b63f8f929bdeec83e66 Mon Sep 17 00:00:00 2001 From: Bas Schoenmaeckers Date: Mon, 9 Dec 2024 21:27:56 +0100 Subject: [PATCH 1/2] Fix chrono deprecation warning --- src/conversions/chrono.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conversions/chrono.rs b/src/conversions/chrono.rs index 90f9c69761d..c80cda4e651 100644 --- a/src/conversions/chrono.rs +++ b/src/conversions/chrono.rs @@ -971,8 +971,8 @@ mod tests { // Also check that trying to convert an out of bound value errors. Python::with_gil(|py| { - assert!(Duration::min_value().into_pyobject(py).is_err()); - assert!(Duration::max_value().into_pyobject(py).is_err()); + assert!(Duration::MIN.into_pyobject(py).is_err()); + assert!(Duration::MAX.into_pyobject(py).is_err()); }); } From cc9f2c4cbd89927a429d0bca3c7e8a6097971baf Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Wed, 11 Dec 2024 10:12:55 -0700 Subject: [PATCH 2/2] use allow(deprecated) instead --- src/conversions/chrono.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conversions/chrono.rs b/src/conversions/chrono.rs index c80cda4e651..bdee4934409 100644 --- a/src/conversions/chrono.rs +++ b/src/conversions/chrono.rs @@ -971,8 +971,12 @@ mod tests { // Also check that trying to convert an out of bound value errors. Python::with_gil(|py| { - assert!(Duration::MIN.into_pyobject(py).is_err()); - assert!(Duration::MAX.into_pyobject(py).is_err()); + // min_value and max_value were deprecated in chrono 0.4.39 + #[allow(deprecated)] + { + assert!(Duration::min_value().into_pyobject(py).is_err()); + assert!(Duration::max_value().into_pyobject(py).is_err()); + } }); }