From 831f2e92292e2fc96709e1662ec8571ea9f9dda2 Mon Sep 17 00:00:00 2001 From: Jonathan Villemaire-Krajden <jonathan.villemaire-krajden@epfl.ch> Date: Sun, 24 Nov 2019 22:58:33 +0100 Subject: [PATCH] AsyncHTTPClient is not context manager. --- access_token_service/ats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/access_token_service/ats.py b/access_token_service/ats.py index a8cf024..278f733 100644 --- a/access_token_service/ats.py +++ b/access_token_service/ats.py @@ -15,9 +15,9 @@ class AccessTokenHandler(HubAuthenticated, RequestHandler): headers = { 'Authorization': f'token {self.hub_auth.api_token}', } - with AsyncHTTPClient as client: - async with client.get(user_endpoint, headers=headers) as resp: - return json.loads(resp) + client = AsyncHTTPClient() + async with client.get(user_endpoint, headers=headers) as resp: + return json.loads(resp) @authenticated async def get(self): -- GitLab