Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion httpx/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ async def _send_single_request(self, request: Request) -> Response:

if not isinstance(request.stream, AsyncByteStream):
raise RuntimeError(
"Attempted to send an sync request with an AsyncClient instance."
"Attempted to send a sync request with an AsyncClient instance."
)

with request_context(request=request):
Expand Down
6 changes: 3 additions & 3 deletions httpx/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ def close(self) -> None:
Automatically called if the response body is read to completion.
"""
if not isinstance(self.stream, SyncByteStream):
raise RuntimeError("Attempted to call an sync close on an async stream.")
raise RuntimeError("Attempted to call a sync close on an async stream.")

if not self.is_closed:
self.is_closed = True
Expand Down Expand Up @@ -1045,7 +1045,7 @@ async def aiter_raw(
if self.is_closed:
raise StreamClosed()
if not isinstance(self.stream, AsyncByteStream):
raise RuntimeError("Attempted to call an async iterator on an sync stream.")
raise RuntimeError("Attempted to call an async iterator on a sync stream.")

self.is_stream_consumed = True
self._num_bytes_downloaded = 0
Expand All @@ -1068,7 +1068,7 @@ async def aclose(self) -> None:
Automatically called if the response body is read to completion.
"""
if not isinstance(self.stream, AsyncByteStream):
raise RuntimeError("Attempted to call an async close on an sync stream.")
raise RuntimeError("Attempted to call an async close on a sync stream.")

if not self.is_closed:
self.is_closed = True
Expand Down