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/core/files/storage/filesystem.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/core/files/storage/filesystem.py')
| -rw-r--r-- | django/core/files/storage/filesystem.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/files/storage/filesystem.py b/django/core/files/storage/filesystem.py index 54c31e536a..428ae61b40 100644 --- a/django/core/files/storage/filesystem.py +++ b/django/core/files/storage/filesystem.py @@ -1,5 +1,5 @@ import os -from datetime import datetime, timezone +from datetime import UTC, datetime from urllib.parse import urljoin from django.conf import settings @@ -215,7 +215,7 @@ class FileSystemStorage(Storage, StorageSettingsMixin): If timezone support is enabled, make an aware datetime object in UTC; otherwise make a naive one in the local timezone. """ - tz = timezone.utc if settings.USE_TZ else None + tz = UTC if settings.USE_TZ else None return datetime.fromtimestamp(ts, tz=tz) def get_accessed_time(self, name): |
