Skip to content

Commit

Permalink
Use SupportsRead as fileobj type
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Nov 14, 2021
1 parent a0477b8 commit 06fa358
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aiodocker/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import warnings
from typing import (
IO,
Any,
AsyncIterator,
Dict,
Expand All @@ -14,6 +13,7 @@
overload,
)

from _typeshed import SupportsRead
from typing_extensions import Literal

from .jsonstream import json_stream_list, json_stream_stream
Expand Down Expand Up @@ -230,7 +230,7 @@ async def delete(
)

@staticmethod
async def _stream(fileobj: IO[bytes]) -> AsyncIterator[bytes]:
async def _stream(fileobj: SupportsRead[bytes]) -> AsyncIterator[bytes]:
chunk = fileobj.read(io.DEFAULT_BUFFER_SIZE)
while chunk:
yield chunk
Expand All @@ -241,7 +241,7 @@ async def build(
self,
*,
remote: str = None,
fileobj: IO[bytes] = None,
fileobj: SupportsRead[bytes] = None,
path_dockerfile: str = None,
tag: str = None,
quiet: bool = False,
Expand All @@ -261,7 +261,7 @@ def build(
self,
*,
remote: str = None,
fileobj: IO[bytes] = None,
fileobj: SupportsRead[bytes] = None,
path_dockerfile: str = None,
tag: str = None,
quiet: bool = False,
Expand All @@ -280,7 +280,7 @@ def build( # noqa: F811
self,
*,
remote: str = None,
fileobj: IO[bytes] = None,
fileobj: SupportsRead[bytes] = None,
path_dockerfile: str = None,
tag: str = None,
quiet: bool = False,
Expand Down

0 comments on commit 06fa358

Please sign in to comment.