Commit 7d40270a authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Input files for wrapper functions were not being deleted

parent ec6d5865
......@@ -1047,7 +1047,8 @@ def fileOrImage(*args, **kwargs):
# in-memory image - we have
# to save it out to a file
if infile is None:
hd, infile = tempfile.mkstemp(fslimage.defaultExt())
hd, infile = tempfile.mkstemp(fslimage.defaultExt(),
dir=workdir)
os.close(hd)
val.to_filename(infile)
......@@ -1110,7 +1111,7 @@ def fileOrArray(*args, **kwargs):
infile = None
if isinstance(val, np.ndarray):
hd, infile = tempfile.mkstemp('.txt')
hd, infile = tempfile.mkstemp('.txt', dir=workdir)
os.close(hd)
np.savetxt(infile, val, fmt='%0.18f')
......@@ -1176,6 +1177,7 @@ def fileOrText(*args, **kwargs):
if not isinstance(val, pathlib.Path):
with tempfile.NamedTemporaryFile(mode='w',
suffix='.txt',
dir=workdir,
delete=False) as f:
f.write(val)
infile = f.name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment