π OpenHands: AI-Driven Development
Add return type annotations to functions in runtime/utils directory (#8335)
Graham Neubigf2af1807e33a
diff --git a/openhands/runtime/utils/edit.py b/openhands/runtime/utils/edit.pyindex 8a189f948e..bdd11bc5fa 100644--- a/openhands/runtime/utils/edit.py+++ b/openhands/runtime/utils/edit.py@@ -4,7 +4,7 @@ import tempfilefrom abc import ABC, abstractmethodfrom typing import Any-from openhands_aci.utils.diff import get_diff # type: ignore+from openhands_aci.utils.diff import get_difffrom openhands.core.config import AppConfigfrom openhands.core.logger import openhands_logger as loggerdiff --git a/openhands/runtime/utils/windows_bash.py b/openhands/runtime/utils/windows_bash.pyindex 30a360dfff..aae6fa6b47 100644--- a/openhands/runtime/utils/windows_bash.py+++ b/openhands/runtime/utils/windows_bash.py@@ -149,7 +149,7 @@ class WindowsPowershellSession:self.close() # Ensure cleanup if init fails partiallyraise 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 = Nonetry:@@ -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 = Nonetry:@@ -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 = Falseself._closed = True- def __del__(self):+ def __del__(self) -> None:"""Destructor ensures the runspace is closed."""self.close()