Skip to content
Snippets Groups Projects
Commit 5bbde65b authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

BF: Input files for wrapper functions were not being deleted

parent 1699706b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment