mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-06 07:16:25 -06:00
Closes #19889: Drop support for Python 3.10 & 3.11
This commit is contained in:
@@ -20,9 +20,4 @@ def datetime_from_timestamp(value):
|
||||
"""
|
||||
Convert an ISO 8601 or RFC 3339 timestamp to a datetime object.
|
||||
"""
|
||||
# Work around UTC issue for Python < 3.11; see
|
||||
# https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat
|
||||
# TODO: Remove this once Python 3.10 is no longer supported
|
||||
if type(value) is str and value.endswith('Z'):
|
||||
value = f'{value[:-1]}+00:00'
|
||||
return datetime.datetime.fromisoformat(value)
|
||||
|
||||
Reference in New Issue
Block a user