Skip to content

Commit f64a873

Browse files
committed
FIX: Raise IOErrors on mkfs.vfat and fusefat calls
1 parent 1262354 commit f64a873

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

nipype/testing/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,19 @@ def __init__(self, size_in_mbytes=8, delay=0.5):
5959
mkfs_args = ['mkfs.vfat', vfatfile]
6060
mount_args = ['fusefat', '-o', 'rw+', '-f', vfatfile, self.vfatmount]
6161

62-
subprocess.check_call(args=mkfs_args, stdout=self.dev_null,
63-
stderr=self.dev_null)
64-
self.fusefat = subprocess.Popen(args=mount_args, stdout=self.dev_null,
65-
stderr=self.dev_null)
62+
try:
63+
subprocess.check_call(args=mkfs_args, stdout=self.dev_null,
64+
stderr=self.dev_null)
65+
except subprocess.CalledProcessError:
66+
raise IOError("mkfs.vfat failed")
67+
68+
try:
69+
self.fusefat = subprocess.Popen(args=mount_args,
70+
stdout=self.dev_null,
71+
stderr=self.dev_null)
72+
except OSError:
73+
raise IOError("fatfuse is not installed")
74+
6675
time.sleep(self.delay)
6776

6877
if self.fusefat.poll() is not None:

0 commit comments

Comments
 (0)