mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-26 02:53:07 +00:00
Add compatibility shim for asyncio.Future creation.
Should provide better support for uvloop.
This commit is contained in:
@@ -31,6 +31,15 @@ try:
|
||||
except AttributeError:
|
||||
create_task = asyncio.async
|
||||
|
||||
try:
|
||||
_create_future = asyncio.AbstractEventLoop.create_future
|
||||
except AttributeError:
|
||||
def create_future(loop):
|
||||
return asyncio.Future(loop=loop)
|
||||
else:
|
||||
def create_future(loop):
|
||||
return loop.create_future()
|
||||
|
||||
try:
|
||||
run_coroutine_threadsafe = asyncio.run_coroutine_threadsafe
|
||||
except AttributeError:
|
||||
|
||||
Reference in New Issue
Block a user