Add return type annotations to functions in runtime/utils directory (#8335)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Graham Neubig
2025-05-07 21:48:39 -04:00
committed by GitHub
parent 3eb0afa1e5
commit f2af1807e3
2 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import tempfile
from abc import ABC, abstractmethod
from typing import Any
from openhands_aci.utils.diff import get_diff # type: ignore
from openhands_aci.utils.diff import get_diff
from openhands.core.config import AppConfig
from openhands.core.logger import openhands_logger as logger

View File

@@ -149,7 +149,7 @@ class WindowsPowershellSession:
self.close() # Ensure cleanup if init fails partially
raise RuntimeError(f'Failed to initialize PowerShell runspace: {e}')
def _set_initial_cwd(self):
def _set_initial_cwd(self) -> None:
"""Sets the initial working directory in the runspace."""
ps = None
try:
@@ -174,7 +174,7 @@ class WindowsPowershellSession:
if ps:
ps.Dispose()
def _confirm_cwd(self):
def _confirm_cwd(self) -> None:
"""Confirms the actual CWD in the runspace and updates self._cwd."""
ps_confirm = None
try:
@@ -1350,7 +1350,7 @@ class WindowsPowershellSession:
content=final_output, command=command, metadata=metadata
)
def close(self):
def close(self) -> None:
"""Closes the PowerShell runspace and releases resources, stopping any active job."""
if self._closed:
return
@@ -1408,6 +1408,6 @@ class WindowsPowershellSession:
self._initialized = False
self._closed = True
def __del__(self):
def __del__(self) -> None:
"""Destructor ensures the runspace is closed."""
self.close()