diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-09 09:03:38 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-17 11:49:15 +0100 |
| commit | e6f82438d4e3750e8d299bfd79dac98eebe9f1e0 (patch) | |
| tree | 4ee0cbf2c0be9822416aa3d65105f35a9784fd94 /django/db/backends/base | |
| parent | 8d98f99a4ab5de6f2c730399f53eba8bf6bea470 (diff) | |
Refs #32365 -- Removed support for pytz timezones per deprecation timeline.
Diffstat (limited to 'django/db/backends/base')
| -rw-r--r-- | django/db/backends/base/base.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/django/db/backends/base/base.py b/django/db/backends/base/base.py index 3b845ec9b3..5f2e7bcd4d 100644 --- a/django/db/backends/base/base.py +++ b/django/db/backends/base/base.py @@ -32,15 +32,6 @@ RAN_DB_VERSION_CHECK = set() logger = logging.getLogger("django.db.backends.base") -# RemovedInDjango50Warning -def timezone_constructor(tzname): - if settings.USE_DEPRECATED_PYTZ: - import pytz - - return pytz.timezone(tzname) - return zoneinfo.ZoneInfo(tzname) - - class BaseDatabaseWrapper: """Represent a database connection.""" @@ -166,7 +157,7 @@ class BaseDatabaseWrapper: elif self.settings_dict["TIME_ZONE"] is None: return datetime.timezone.utc else: - return timezone_constructor(self.settings_dict["TIME_ZONE"]) + return zoneinfo.ZoneInfo(self.settings_dict["TIME_ZONE"]) @cached_property def timezone_name(self): |
