From efb7f9ced2dcf71294353596a265e3fd67faffeb Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 18 Feb 2025 08:35:36 +0100 Subject: Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. datetime.UTC was added in Python 3.11. --- django/http/response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django/http') diff --git a/django/http/response.py b/django/http/response.py index 4a0ea67013..6d09bc87e2 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -240,8 +240,8 @@ class HttpResponseBase: if expires is not None: if isinstance(expires, datetime.datetime): if timezone.is_naive(expires): - expires = timezone.make_aware(expires, datetime.timezone.utc) - delta = expires - datetime.datetime.now(tz=datetime.timezone.utc) + expires = timezone.make_aware(expires, datetime.UTC) + delta = expires - datetime.datetime.now(tz=datetime.UTC) # Add one second so the date matches exactly (a fraction of # time gets lost between converting to a timedelta and # then the date string). -- cgit v1.3