mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 16:03:00 +00:00
Merge pull request #2149 from minrk/deprecate-maybe-future
stop using deprecated `gen.maybe_future`
This commit is contained in:
@@ -449,7 +449,11 @@ def maybe_future(obj):
|
|||||||
elif isinstance(obj, concurrent.futures.Future):
|
elif isinstance(obj, concurrent.futures.Future):
|
||||||
return asyncio.wrap_future(obj)
|
return asyncio.wrap_future(obj)
|
||||||
else:
|
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
|
@asynccontextmanager
|
||||||
|
Reference in New Issue
Block a user