Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neagu committed Dec 16, 2024
1 parent 0f315e0 commit 7ede41a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def _get_file_count(zip_path: Path) -> int:
raise SevenZipError(command=result.command, command_result=result.message)

match = re.search(r"\s*(\d+)\s*files", result.message)
return int(match.group().replace("files", "").strip())
return int(match.group().replace("files", "").strip() if match else "0")


async def unarchive_zip_to(
Expand All @@ -37,6 +37,8 @@ async def unarchive_zip_to(
process = await asyncio.create_subprocess_shell(
command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
)
assert process.stdout # nosec
assert process.stderr # nosec

async with progress_bar.sub_progress(
steps=file_count, description=IDStr("...")
Expand Down

0 comments on commit 7ede41a

Please sign in to comment.