Skip to content

Commit

Permalink
Make Cognito call async (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl authored Oct 26, 2021
1 parent a75f25d commit 87d92ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyhoma/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" Python wrapper for the Tahoma API """
from __future__ import annotations

import asyncio
import urllib.parse
from json import JSONDecodeError
from types import TracebackType
Expand Down Expand Up @@ -200,7 +201,8 @@ async def nexity_login(self) -> str:
)

try:
tokens = aws.authenticate_user()
loop = asyncio.get_event_loop()
tokens = await loop.run_in_executor(None, aws.authenticate_user)
except Exception as error:
raise NexityBadCredentialsException() from error

Expand Down

0 comments on commit 87d92ef

Please sign in to comment.