asyncio.wait takes an iterable, not args

This commit is contained in:
Darryl Nixon 2023-07-16 14:00:13 -07:00
parent 3e0e138caa
commit 00ad322c58

View file

@ -34,7 +34,7 @@ async def main(job: argparse.Namespace) -> bool:
tasks.append(path.shred(hash=job.exhaustive, dryrun=job.dryrun)) tasks.append(path.shred(hash=job.exhaustive, dryrun=job.dryrun))
elif isinstance(path, ShredDir): elif isinstance(path, ShredDir):
tasks.append(path.shred(hash=job.exhaustive, dryrun=job.dryrun)) tasks.append(path.shred(hash=job.exhaustive, dryrun=job.dryrun))
done, _ = await asyncio.wait(*tasks) done, _ = await asyncio.wait(tasks)
for task in done: for task in done:
e = task.exception() e = task.exception()
if e: if e:
@ -68,7 +68,7 @@ async def main(job: argparse.Namespace) -> bool:
tasks = [] tasks = []
async for item in mount_point.rglob("*"): async for item in mount_point.rglob("*"):
tasks.append(check_inode_and_unlink(item)) tasks.append(check_inode_and_unlink(item))
done, _ = await asyncio.wait(*tasks) done, _ = await asyncio.wait(tasks)
for task in done: for task in done:
e = task.exception() e = task.exception()
if e: if e: