Skip to content

Commit

Permalink
Improve type-anno
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jun 12, 2024
1 parent f017a6a commit 16036a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion aiodocker/execs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
from typing import (
TYPE_CHECKING,
Any,
Dict,
Literal,
Optional,
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion aiodocker/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class Message(NamedTuple):


class Stream:
_resp: aiohttp.ClientResponse | None

def __init__(
self,
docker: "Docker",
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 16036a9

Please sign in to comment.