Merge pull request #2149 from minrk/deprecate-maybe-future

stop using deprecated `gen.maybe_future`
This commit is contained in:
Carol Willing
2018-09-17 20:08:57 -07:00
committed by GitHub

View File

@@ -449,7 +449,11 @@ def maybe_future(obj):
elif isinstance(obj, concurrent.futures.Future):
return asyncio.wrap_future(obj)
else:
return to_asyncio_future(gen.maybe_future(obj))
# could also check for tornado.concurrent.Future
# but with tornado >= 5 tornado.Future is asyncio.Future
f = asyncio.Future()
f.set_result(obj)
return f
@asynccontextmanager