@@ -46,7 +46,7 @@ async def read(self, size: int = -1) -> bytes:
4646 if self ._closed or not self ._data :
4747 raise ValueError ("I/O operation on closed file." )
4848
49- if isinstance (self ._data , BytesReader ) and not iscoroutinefunction ( # type: ignore - TODO(pyright)
49+ if isinstance (self ._data , BytesReader ) and not iscoroutinefunction ( # type: ignore - TODO(pyright)
5050 self ._data .read
5151 ):
5252 # Python's runtime_checkable can't actually tell the difference between
@@ -135,7 +135,7 @@ def __init__(self, data: StreamingBlob):
135135 if isinstance (data , bytes | bytearray ):
136136 self ._buffer = BytesIO (data )
137137 self ._data_source = None
138- elif isinstance (data , AsyncByteStream ) and iscoroutinefunction (data .read ): # type: ignore - TODO(pyright)
138+ elif isinstance (data , AsyncByteStream ) and iscoroutinefunction (data .read ): # type: ignore - TODO(pyright)
139139 # Note that we need that iscoroutine check because python won't actually check
140140 # whether or not the read function is async.
141141 self ._buffer = BytesIO ()
@@ -321,7 +321,6 @@ async def write(self, data: bytes) -> None:
321321 # Acquire a lock on the data buffer, releasing it automatically when the
322322 # block exits.
323323 async with self ._data_condition :
324-
325324 # Wait for the number of chunks in the buffer to be less than the
326325 # specified maximum. This also releases the lock until that condition
327326 # is met.
@@ -407,7 +406,6 @@ async def __anext__(self) -> bytes:
407406 # Acquire a lock on the data buffer, releasing it automatically when the
408407 # block exits.
409408 async with self ._data_condition :
410-
411409 # Wait for the stream to be closed or for the data buffer to be non-empty.
412410 # This also releases the lock until that condition is met.
413411 await self ._data_condition .wait_for (
0 commit comments