diff options
Diffstat (limited to 'project/utils.py')
-rw-r--r-- | project/utils.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/project/utils.py b/project/utils.py index c63b8a4..8485dfa 100644 --- a/project/utils.py +++ b/project/utils.py @@ -68,7 +68,7 @@ def delete(path): @contextmanager -def temp_file(contents, **kwargs): +def temp_file(**kwargs): '''Make NamedTemporaryFile usable on Windows. It can't be opened a second time on Windows, hence this silliness. @@ -76,8 +76,7 @@ def temp_file(contents, **kwargs): tmp = tempfile.NamedTemporaryFile(delete=False, **kwargs) with tmp as file, delete_on_error(file.name): path = file.name - logging.info('Writing temporary file: %s', path) - file.write(contents) + logging.info('Created temporary file: %s', path) with delete(path): yield path |