mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
refactor: use with statement with multiple contexts
Otherwise `ruff` check SIM117 fails.
This commit is contained in:
@@ -16,9 +16,8 @@ async def get_temp_credentials() -> dict:
|
|||||||
|
|
||||||
# Replace default 5 minute timeout with a 1 minute timeout.
|
# Replace default 5 minute timeout with a 1 minute timeout.
|
||||||
timeout = aiohttp.ClientTimeout(total=60)
|
timeout = aiohttp.ClientTimeout(total=60)
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session, session.post(url, timeout=timeout) as response:
|
||||||
async with session.post(url, timeout=timeout) as response:
|
return json.loads(await response.text())
|
||||||
return json.loads(await response.text())
|
|
||||||
|
|
||||||
|
|
||||||
class ACFactory:
|
class ACFactory:
|
||||||
|
|||||||
Reference in New Issue
Block a user