Skip to content

Commit

Permalink
preen
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 10, 2024
1 parent 6ab8a44 commit 20a015b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,18 +677,16 @@ async def send(self, conn: "Connection") -> "ClientResponse":
v = self.version
status_line = f"{self.method} {path} HTTP/{v.major}.{v.minor}"
await writer.write_headers(status_line, self.headers)
task: Optional["asyncio.Task[None]"]
if self.body or self._continue is not None or protocol.writing_paused:
coro = self.write_bytes(writer, conn)

task: Optional["asyncio.Task[None]"]
if sys.version_info >= (3, 12):
# Optimization for Python 3.12, try to write
# bytes immediately to avoid having to schedule
# the task on the event loop.
task = asyncio.Task(coro, loop=self.loop, eager_start=True)
else:
task = self.loop.create_task(coro)

if task.done():
task = None
else:
Expand Down

0 comments on commit 20a015b

Please sign in to comment.