Explorar o código

Fix Python 3.9 compatibility for type hints

Use typing.Optional and typing.Tuple instead of Python 3.10+ union
syntax (str | None) for backwards compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris hai 2 semanas
pai
achega
77eb462e77
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      modules/update/update_manager.py

+ 2 - 1
modules/update/update_manager.py

@@ -3,6 +3,7 @@ import logging
 import os
 from pathlib import Path
 from datetime import datetime
+from typing import Optional, Tuple
 
 # Configure logging
 logger = logging.getLogger(__name__)
@@ -71,7 +72,7 @@ def is_update_watcher_available() -> bool:
         return False
 
 
-def trigger_host_update(message: str = None) -> tuple[bool, str | None]:
+def trigger_host_update(message: str = None) -> Tuple[bool, Optional[str]]:
     """Signal the host to run 'dw update' by creating a trigger file.
 
     The update watcher service on the host monitors this file and