diff options
| author | 2022-11-19 10:56:37 -0500 | |
|---|---|---|
| committer | 2022-11-19 10:56:37 -0500 | |
| commit | 09bbc4f11f32d91dfa20aeb3da77a5e2a054f49d (patch) | |
| tree | 91e51b320ebaa3a07388cc6567e517331b3ce7ca | |
| parent | Add `size` and `compression` to attachment fields (diff) | |
Use rmdir instead of rmtree
| -rw-r--r-- | snekbox/memfs.py | 4 | 
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: | 
