Stray await

This commit is contained in:
Darryl Nixon 2023-07-16 13:37:58 -07:00
parent 04bce50fb9
commit efce306977

View file

@ -3,7 +3,6 @@ import hashlib
from collections.abc import Generator
from pathlib import Path
from secrets import token_bytes
from typing import List
from typing import Set
from typing import Union
@ -40,7 +39,7 @@ class ShredDir(AsyncObject):
stat = await path.stat()
self.inode = stat.st_ino
async def _get_contents(self, recursive: bool) -> List:
async def _get_contents(self, recursive: bool) -> Set:
tasks = []
async for subpath in self.absolute_path.glob("*"):
if await subpath.is_dir():
@ -52,8 +51,8 @@ class ShredDir(AsyncObject):
else:
logger.warning(f"Subdirectory found: {subpath}, skipping (see -r/--recursive))")
elif subpath.is_file():
tasks.append(await ShredFile(subpath))
return await asyncio.gather(*tasks)
tasks.append(ShredFile(subpath))
return set(await asyncio.gather(*tasks))
def enumerate_mount_points(self) -> Generator:
for item in self.contents: