mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
asyncio: async() function is deprecated in favour of ensure_future().
This commit is contained in:
parent
740169cd24
commit
59eb9a4da5
7 changed files with 57 additions and 34 deletions
|
|
@ -315,7 +315,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
self._check_closed()
|
||||
|
||||
new_task = not isinstance(future, futures.Future)
|
||||
future = tasks.async(future, loop=self)
|
||||
future = tasks.ensure_future(future, loop=self)
|
||||
if new_task:
|
||||
# An exception is raised if the future didn't complete, so there
|
||||
# is no need to log the "destroy pending task" message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue