8000 Update Lib/asyncio/timeouts.py · python/cpython@418a81f · GitHub
[go: up one dir, main page]

Skip to content

Commit 418a81f

Browse files
authored
Update Lib/asyncio/timeouts.py
1 parent 51686d7 commit 418a81f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Lib/asyncio/timeouts.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,7 @@ def timeout(delay: Optional[float]) -> Timeout:
126126
into TimeoutError.
127127
"""
128128
loop = events.get_running_loop()
129-
if delay is None:
130-
return Timeout(None)
131-
132-
if delay <= 0:
133-
return Timeout(0)
134-
135-
return Timeout(loop.time() + delay)
129+
return Timeout(loop.time() + delay if delay is not None else None)
136130

137131

138132
def timeout_at(when: Optional[float]) -> Timeout:

0 commit comments

Comments
 (0)
0