Commit 35fae740 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'bug_close_files' into 'master'

BUG: close file handles

See merge request fsl/fslpy!291
parents c1580382 20b758c4
......@@ -495,9 +495,10 @@ def func_to_cmd(func, args=None, kwargs=None, tmp_dir=None, clean="never", verbo
pickle.dump(('module', func.__module__, func.__name__,
args, kwargs), pickle_bytes)
_, filename = tempfile.mkstemp(prefix=func.__name__ + '_',
suffix='.py',
dir=tmp_dir)
handle, filename = tempfile.mkstemp(prefix=func.__name__ + '_',
suffix='.py',
dir=tmp_dir)
os.close(handle)
verbose_script = f'\nprint("running {filename}")\n' if verbose else ''
if clean == 'never':
......
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