mirror of
git://git.yoctoproject.org/poky
synced 2026-04-02 02:49:11 +00:00
bitbake: bitbake-server: use with to avoid ResourceWarning
Prevents the following warning in bitbake-cookerdaemon.log: 2386729 10:54:16.195427 Exiting (socket: True) 2386729 10:54:16.201065 Exiting as we could obtain the lock sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/laplante/main_yocto/build/bitbake-cookerdaemon.log' mode='a+' encoding='UTF-8'> (Bitbake rev: 8dbf1ec8139d9dd7f52c1773cccbe7696b3ec1b4) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
331270628c
commit
0f83df527d
@ -38,9 +38,9 @@ if xmlrpcinterface[0] == "None":
|
||||
with open('/dev/null', 'r') as si:
|
||||
os.dup2(si.fileno(), sys.stdin.fileno())
|
||||
|
||||
so = open(logfile, 'a+')
|
||||
os.dup2(so.fileno(), sys.stdout.fileno())
|
||||
os.dup2(so.fileno(), sys.stderr.fileno())
|
||||
with open(logfile, 'a+') as so:
|
||||
os.dup2(so.fileno(), sys.stdout.fileno())
|
||||
os.dup2(so.fileno(), sys.stderr.fileno())
|
||||
|
||||
# Have stdout and stderr be the same so log output matches chronologically
|
||||
# and there aren't two seperate buffers
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user