From 926f5cf8e427d08b0a4670d89e3b0f342c299489 Mon Sep 17 00:00:00 2001 From: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:33:39 +0100 Subject: [PATCH] Fix chrono deprecation warning (#4785) * Fix chrono deprecation warning * use allow(deprecated) instead --------- Co-authored-by: Nathan Goldbaum --- 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 90f9c69761d..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_value().into_pyobject(py).is_err()); - assert!(Duration::max_value().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()); + } }); }