Unverified Kaydet (Commit) 5382c050 authored tarafından Andrew Svetlov's avatar Andrew Svetlov Kaydeden (comit) GitHub

bpo-32351: Use fastpath in asyncio.sleep if delay<0 (#4908)

* Use fastpath in asyncio.sleep if delay<0

* Add NEWS entry
üst 44d1a591
...@@ -503,7 +503,7 @@ def __sleep0(): ...@@ -503,7 +503,7 @@ def __sleep0():
async def sleep(delay, result=None, *, loop=None): async def sleep(delay, result=None, *, loop=None):
"""Coroutine that completes after a given time (in seconds).""" """Coroutine that completes after a given time (in seconds)."""
if delay == 0: if delay <= 0:
await __sleep0() await __sleep0()
return result return result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment