EDM115 / unzip-bot

with statements can be merged PTC-W0062
Anti-pattern
Major
4 months ago2 years old
Consider merging collapsible With statements`
  76
  77async def download_with_progress(url, path, message, unzip_bot):
  78    try:
  79        async with ClientSession() as session:  80            async with session.get(url, timeout=None, allow_redirects=True) as resp:
  81                total_size = int(resp.headers.get("Content-Length", 0))
  82                current_size = 0
Consider merging collapsible With statements`
  63
  64async def download(url, path):
  65    try:
  66        async with ClientSession() as session:  67            async with session.get(url, timeout=None, allow_redirects=True) as resp:
  68                async with openfile(path, mode="wb") as file:
  69                    async for chunk in resp.content.iter_chunked(Config.CHUNK_SIZE):