Add compatibility shim for asyncio.Future creation.

Should provide better support for uvloop.
This commit is contained in:
Rapptz
2017-01-25 21:38:50 -05:00
parent 62f43889c0
commit b876133e87
4 changed files with 13 additions and 4 deletions

View File

@@ -678,7 +678,7 @@ class Client:
return result
future = asyncio.Future(loop=self.loop)
future = compat.create_future(self.loop)
self._listeners.append((predicate, future, WaitForType.message))
try:
message = yield from asyncio.wait_for(future, timeout, loop=self.loop)
@@ -788,7 +788,7 @@ class Client:
return result
future = asyncio.Future(loop=self.loop)
future = compat.create_future(self.loop)
self._listeners.append((predicate, future, WaitForType.reaction))
try:
return (yield from asyncio.wait_for(future, timeout, loop=self.loop))