mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-10 02:43:02 +02:00
fix: Python 3.10 compat for datetime.UTC in api_endpoints
datetime.UTC was added in Python 3.11. Fall back to timezone.utc on older interpreters, matching the existing pattern in mqtt_handler.py. Co-Authored-By: Zindello <josh@zindello.com.au>
This commit is contained in:
@@ -2,7 +2,13 @@ import json
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
from datetime import UTC, datetime
|
||||
from datetime import datetime
|
||||
|
||||
try:
|
||||
from datetime import UTC
|
||||
except ImportError:
|
||||
from datetime import timezone
|
||||
UTC = timezone.utc
|
||||
from pathlib import Path
|
||||
from typing import Callable, Optional
|
||||
|
||||
|
||||
Reference in New Issue
Block a user