mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
asyncio: Remove asyncio/compat.py (#4606)
The asyncio/compat.py file was written to support Python < 3.5 and Python < 3.5.2. But Python 3.5 doesn't accept bugfixes anymore, only security fixes. There is no more need to backport bugfixes to Python 3.5, and so no need to have a single code base for Python 3.5, 3.6 and 3.7. Say hello (again) to "async" and "await", who became real keywords in Python 3.7 ;-)
This commit is contained in:
parent
a10dc3efcb
commit
3f438a9fa0
7 changed files with 37 additions and 60 deletions
|
@ -13,7 +13,6 @@ import warnings
|
|||
import weakref
|
||||
|
||||
from . import base_tasks
|
||||
from . import compat
|
||||
from . import coroutines
|
||||
from . import events
|
||||
from . import futures
|
||||
|
@ -525,7 +524,7 @@ def ensure_future(coro_or_future, *, loop=None):
|
|||
if task._source_traceback:
|
||||
del task._source_traceback[-1]
|
||||
return task
|
||||
elif compat.PY35 and inspect.isawaitable(coro_or_future):
|
||||
elif inspect.isawaitable(coro_or_future):
|
||||
return ensure_future(_wrap_awaitable(coro_or_future), loop=loop)
|
||||
else:
|
||||
raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue