summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2017-12-17 14:41:30 (GMT)
committerGitHub <noreply@github.com>2017-12-17 14:41:30 (GMT)
commit5382c05021026fe623def829d121f5f6af4909fb (patch)
tree00737c326fe1dab3be5206195bf3164bc2e14961 /Lib/asyncio
parent44d1a5912ea629aa20fdc377a5ab69d9ccf75d61 (diff)
downloadcpython-5382c05021026fe623def829d121f5f6af4909fb.zip
cpython-5382c05021026fe623def829d121f5f6af4909fb.tar.gz
cpython-5382c05021026fe623def829d121f5f6af4909fb.tar.bz2
bpo-32351: Use fastpath in asyncio.sleep if delay<0 (#4908)
* Use fastpath in asyncio.sleep if delay<0 * Add NEWS entry
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/tasks.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index cdb483a..275141c 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -503,7 +503,7 @@ def __sleep0():
async def sleep(delay, result=None, *, loop=None):
"""Coroutine that completes after a given time (in seconds)."""
- if delay == 0:
+ if delay <= 0:
await __sleep0()
return result