From 0058ed803d611d1d585f7d96b80c3b0586f64560 Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Thu, 22 Aug 2019 15:06:08 +0300 Subject: [PATCH] Address feedback --- jupyterhub/handlers/pages.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jupyterhub/handlers/pages.py b/jupyterhub/handlers/pages.py index 68264afc..53525dc8 100644 --- a/jupyterhub/handlers/pages.py +++ b/jupyterhub/handlers/pages.py @@ -175,16 +175,14 @@ class SpawnHandler(BaseHandler): done, pending = await asyncio.wait([f], timeout=1) # If spawn_single_user throws an exception, raise a 500 error # otherwise it may cause a redirect loop - if f in done: - future, = done - exc = future.exception() + if f.done() and f.exception(): + exc = f.exception() if exc: raise web.HTTPError( 500, "Error in Authenticator.pre_spawn_start: %s %s" % (type(exc).__name__, str(exc)), ) - return self.redirect(pending_url) @web.authenticated