Update rest_framework/utils/timezone.py

This commit is contained in:
Tom Christie 2025-03-21 12:31:35 +00:00 committed by GitHub
parent c74365117e
commit 715ea1d3b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
from datetime import datetime, timezone, tzinfo from datetime import datetime, timezone, tzinfo
def datetime_exists(dt: datetime) -> bool: def datetime_exists(dt) -> bool:
"""Check if a datetime exists. Taken from: https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html""" """Check if a datetime exists. Taken from: https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html"""
# There are no non-existent times in UTC, and comparisons between # There are no non-existent times in UTC, and comparisons between
# aware time zones always compare absolute times; if a datetime is # aware time zones always compare absolute times; if a datetime is