Skip to content

Commit

Permalink
pythongh-108903: Remove unneeded lambdas from asyncio (pythonGH-1…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Sep 5, 2023
1 parent 1e0d627 commit ad1d6a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Doc/library/asyncio-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ received data, and close the connection::
loop = asyncio.get_running_loop()

server = await loop.create_server(
lambda: EchoServerProtocol(),
EchoServerProtocol,
'127.0.0.1', 8888)

async with server:
Expand Down Expand Up @@ -850,7 +850,7 @@ method, sends back received data::
# One protocol instance will be created to serve all
# client requests.
transport, protocol = await loop.create_datagram_endpoint(
lambda: EchoServerProtocol(),
EchoServerProtocol,
local_addr=('127.0.0.1', 9999))

try:
Expand Down
6 changes: 3 additions & 3 deletions Lib/asyncio/sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def _start_handshake(self):
# start handshake timeout count down
self._handshake_timeout_handle = \
self._loop.call_later(self._ssl_handshake_timeout,
lambda: self._check_handshake_timeout())
self._check_handshake_timeout)

self._do_handshake()

Expand Down Expand Up @@ -619,7 +619,7 @@ def _start_shutdown(self):
self._set_state(SSLProtocolState.FLUSHING)
self._shutdown_timeout_handle = self._loop.call_later(
self._ssl_shutdown_timeout,
lambda: self._check_shutdown_timeout()
self._check_shutdown_timeout
)
self._do_flush()

Expand Down Expand Up @@ -758,7 +758,7 @@ def _do_read__buffered(self):
else:
break
else:
self._loop.call_soon(lambda: self._do_read())
self._loop.call_soon(self._do_read)
except SSLAgainErrors:
pass
if offset > 0:
Expand Down

0 comments on commit ad1d6a1

Please sign in to comment.