From 6f891d0c5651e226bf47c669269cd31ad2393423 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Thu, 22 Oct 2026 00:06:11 -0400 Subject: [PATCH] Remove deprecated use of dateutil.zoneinfo `dateutil.zoneinfo` is deprecated in version 3.0+, but it turns out that this test is not actually *using* dateutil in any meaningful way, because it takes the union of the dateutil zones and the zoneinfo zones, and then discards all the ones that are not in the zoneinfo set, which is equivalent to just using the zoneinfo zones directly. So, I've simply removed the deprecated zoneinfo usage. --- tests/utils.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 834aee05c..49efb2ce0 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -2,17 +2,12 @@ import zoneinfo except ImportError: from backports import zoneinfo -from dateutil.zoneinfo import get_zonefile_instance def make_full_tz_list(): - dateutil_zones = set(get_zonefile_instance().zones) - zoneinfo_zones = set(zoneinfo.available_timezones()) # Since the tests create ZoneInfo objects, we can only use timezones - # that are available in zoneinfo. Filter out any dateutil-only timezones - # that are not available in zoneinfo (like Asia/Hanoi which was renamed to Asia/Ho_Chi_Minh) - all_zones = dateutil_zones.union(zoneinfo_zones) - return {tz for tz in all_zones if tz in zoneinfo_zones} + # that are available in zoneinfo. + return zoneinfo.available_timezones() def assert_datetime_equality(dt1, dt2, within=10):