Skip to content
Snippets Groups Projects
Commit 20b758c4 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

BUG: close file handles

parent c1580382
No related branches found
No related tags found
No related merge requests found
...@@ -495,9 +495,10 @@ def func_to_cmd(func, args=None, kwargs=None, tmp_dir=None, clean="never", verbo ...@@ -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__, pickle.dump(('module', func.__module__, func.__name__,
args, kwargs), pickle_bytes) args, kwargs), pickle_bytes)
_, filename = tempfile.mkstemp(prefix=func.__name__ + '_', handle, filename = tempfile.mkstemp(prefix=func.__name__ + '_',
suffix='.py', suffix='.py',
dir=tmp_dir) dir=tmp_dir)
os.close(handle)
verbose_script = f'\nprint("running {filename}")\n' if verbose else '' verbose_script = f'\nprint("running {filename}")\n' if verbose else ''
if clean == 'never': if clean == 'never':
......
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