Fix the following warning.
ResourceWarning: unclosed file <_io.TextIOWrapper name='/.../systemd/1_239-r0/debugsources.list' mode='a' encoding='UTF-8'>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
# is still assuming that.
debuglistoutput = '\0'.join(debugsources) + '\0'
lf = bb.utils.lockfile(sourcefile + ".lock")
- open(sourcefile, 'a').write(debuglistoutput)
+ with open(sourcefile, 'a') as sf:
+ sf.write(debuglistoutput)
bb.utils.unlockfile(lf)