diff --git a/melamine/classes.py b/melamine/classes.py index 95c8e43..08789c7 100644 --- a/melamine/classes.py +++ b/melamine/classes.py @@ -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: