From 9fe0142fa5da3cb33f13eb7ed41430064cd021cd Mon Sep 17 00:00:00 2001 From: Zindello Date: Wed, 27 May 2026 11:03:15 +1000 Subject: [PATCH] fix: replace datetime.UTC with timezone.utc for Python 3.10 compat datetime.UTC was introduced in Python 3.11. timezone.utc is available since Python 3.2 and is functionally identical. Co-Authored-By: Zindello --- repeater/web/api_endpoints.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/repeater/web/api_endpoints.py b/repeater/web/api_endpoints.py index 20d2ca0..56cf8c2 100644 --- a/repeater/web/api_endpoints.py +++ b/repeater/web/api_endpoints.py @@ -2,13 +2,7 @@ import json import logging import os import time -from datetime import datetime - -try: - from datetime import UTC -except ImportError: - from datetime import timezone - UTC = timezone.utc +from datetime import datetime, timezone from pathlib import Path from typing import Callable, Optional @@ -5256,7 +5250,7 @@ class APIEndpoints: exported = _sanitize(exported) meta = { - "exported_at": datetime.now(UTC).isoformat().replace("+00:00", "Z"), + "exported_at": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"), "version": __version__, "config_path": self._config_path, "includes_secrets": full_backup,