From b246b3fde3e924e812d3fdd6d157cb29d413012c Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Wed, 6 Nov 2024 08:15:13 -0600 Subject: [PATCH] Fix comparing timezone and non-timezone timestamps --- utils/release_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/release_helper.py b/utils/release_helper.py index aa251b441f2..1a16cd765fc 100755 --- a/utils/release_helper.py +++ b/utils/release_helper.py @@ -11,7 +11,8 @@ # - https://pygithub.readthedocs.io/en/latest/github_objects.html # - https://docs.github.com/en/rest -from datetime import datetime, timedelta +from datetime import datetime, timedelta, UTC + from github import Github import argparse import configparser @@ -362,7 +363,7 @@ def get_next_stabilization_date(release_date) -> datetime: def get_next_release_date(latest_release_date: datetime) -> datetime: month = get_next_quarter_first_month(latest_release_date) - now = datetime.now() + now = datetime.now(UTC) if month > 9 and latest_release_date <= now: year = latest_release_date.year + 1