aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ionite34 <[email protected]>2022-11-19 10:56:37 -0500
committerGravatar ionite34 <[email protected]>2022-11-19 10:56:37 -0500
commit09bbc4f11f32d91dfa20aeb3da77a5e2a054f49d (patch)
tree91e51b320ebaa3a07388cc6567e517331b3ce7ca
parentAdd `size` and `compression` to attachment fields (diff)
Use rmdir instead of rmtree
-rw-r--r--snekbox/memfs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/snekbox/memfs.py b/snekbox/memfs.py
index f45e37a..2372d43 100644
--- a/snekbox/memfs.py
+++ b/snekbox/memfs.py
@@ -7,7 +7,6 @@ import subprocess
from collections.abc import Generator
from contextlib import contextmanager
from pathlib import Path
-from shutil import rmtree
from threading import BoundedSemaphore
from types import TracebackType
from typing import Type
@@ -48,7 +47,8 @@ def unmount_tmpfs(name: str) -> None:
"""Unmount and remove a tmpfs directory."""
tmp = NAMESPACE_DIR / name
subprocess.check_call(["umount", str(tmp)])
- rmtree(tmp, ignore_errors=True)
+ # Unmounting will not remove the original folder, so do that here
+ tmp.rmdir()
class MemFS: