Clean env on remove-folder (#2839)

This commit is contained in:
Pascal Vizeli 2021-04-26 19:47:46 +02:00 committed by GitHub
parent 9112f27dc0
commit 29e55d3664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -86,7 +86,11 @@ async def remove_folder(folder: Path, content_only: bool = False) -> None:
del_folder = f"{folder}" + "/{,.[!.],..?}*" if content_only else f"{folder}"
try:
proc = await asyncio.create_subprocess_exec(
"bash", "-c", f"rm -rf {del_folder}", stdout=asyncio.subprocess.DEVNULL
"bash",
"-c",
f"rm -rf {del_folder}",
stdout=asyncio.subprocess.DEVNULL,
env=clean_env(),
)
_, error_msg = await proc.communicate()