summaryrefslogtreecommitdiff
path: root/buildstream/_fuse
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/_fuse')
-rw-r--r--buildstream/_fuse/mount.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/buildstream/_fuse/mount.py b/buildstream/_fuse/mount.py
index 8220a8d07..3848ad305 100644
--- a/buildstream/_fuse/mount.py
+++ b/buildstream/_fuse/mount.py
@@ -143,12 +143,11 @@ class Mount():
@contextmanager
def mounted(self, mountpoint):
- def kill_proc():
- self.unmount()
-
- with _signals.terminator(kill_proc):
- self.mount(mountpoint)
- yield
+ self.mount(mountpoint)
+ try:
+ with _signals.terminator(self.unmount):
+ yield
+ finally:
self.unmount()
################################################