diff --git a/aiodocker/execs.py b/aiodocker/execs.py index 859c3709..c18acaf5 100644 --- a/aiodocker/execs.py +++ b/aiodocker/execs.py @@ -3,6 +3,7 @@ import json from typing import ( TYPE_CHECKING, + Any, Dict, Literal, Optional, @@ -77,7 +78,12 @@ async def start( ) -> bytes: pass - def start(self, *, timeout=None, detach=False): + def start( + self, + *, + timeout: aiohttp.ClientTimeout | None = None, + detach: bool = False, + ) -> Any: """ Start this exec instance. Args: diff --git a/aiodocker/stream.py b/aiodocker/stream.py index 1c538e62..fedd8803 100644 --- a/aiodocker/stream.py +++ b/aiodocker/stream.py @@ -22,6 +22,8 @@ class Message(NamedTuple): class Stream: + _resp: aiohttp.ClientResponse | None + def __init__( self, docker: "Docker", @@ -132,8 +134,9 @@ async def __aexit__( exc_typ: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType, - ) -> None: + ) -> Optional[bool]: await self.close() + return None def __del__(self, _warnings=warnings) -> None: if self._resp is not None: