diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2025-02-18 08:35:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-18 08:35:36 +0100 |
| commit | efb7f9ced2dcf71294353596a265e3fd67faffeb (patch) | |
| tree | b24b6127022fbe48c517d1acbe9e3c0c502391d9 /django/http/response.py | |
| parent | 0d1dd6bba0c18b7feb6caa5cbd8df80fbac54afd (diff) | |
Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.
datetime.UTC was added in Python 3.11.
Diffstat (limited to 'django/http/response.py')
| -rw-r--r-- | django/http/response.py | 4 |
1 files changed, 2 insertions, 2 deletions
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). |
