summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2017-07-10 16:05:03 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2017-07-10 16:10:56 +0100
commiteecec59a93fba04fd9b84e474cf4237aea35ff16 (patch)
tree32a1c1fd2a4ed8a61fd4a06634b81b422c11a92f
parent5be75163ab3aa59c1adcb7ad39751e1da6cf918b (diff)
downloadbuildstream-eecec59a93fba04fd9b84e474cf4237aea35ff16.tar.gz
utils.py: Fix _tempdir for python3.4
Support for prefix=None and suffix=None was added in python 3.5. The default for suffix happens to be "", and the prefix happens to be "tmp" (though that's an implementation detail), but it's sufficient, and simpler than writing conditionals that omit certain args.
-rw-r--r--buildstream/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py
index 96b91a94c..764a4951c 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -678,7 +678,7 @@ def _set_deterministic_mtime(directory):
# supports cleaning up the temp directory on SIGTERM.
#
@contextmanager
-def _tempdir(suffix=None, prefix=None, dir=None):
+def _tempdir(suffix="", prefix="tmp", dir=None):
tempdir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir)
def cleanup_tempdir():