Просмотр исходного кода

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 2 недель назад
Родитель
Сommit
77eb462e77
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      modules/update/update_manager.py

+ 2 - 1
modules/update/update_manager.py

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