combo-layer: python3: use tempfile.TemporaryFile

Used tempfile.TemporaryFile() API instead of deprecated
os.tmpfile().

(From OE-Core rev: bf1b411eb1cd2cc960325d5fdb0cb4f4f7b1e40e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh 2016-06-02 13:13:01 +03:00 committed by Richard Purdie
parent f1e85d4760
commit a8314b9531
1 changed files with 2 additions and 2 deletions

View File

@ -185,10 +185,10 @@ def runcmd(cmd,destdir=None,printerr=True,out=None,env=None):
"""
logger.debug("run cmd '%s' in %s" % (cmd, os.getcwd() if destdir is None else destdir))
if not out:
out = os.tmpfile()
out = tempfile.TemporaryFile()
err = out
else:
err = os.tmpfile()
err = tempfile.TemporaryFile()
try:
subprocess.check_call(cmd, stdout=out, stderr=err, cwd=destdir, shell=isinstance(cmd, str), env=env or os.environ)
except subprocess.CalledProcessError as e: