diff options
Diffstat (limited to 'discord/compat.py')
| -rw-r--r-- | discord/compat.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/discord/compat.py b/discord/compat.py index 43294254..3b9e66ff 100644 --- a/discord/compat.py +++ b/discord/compat.py @@ -32,6 +32,15 @@ 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: # the following code is slightly modified from the |