mirror of
https://git.yoctoproject.org/poky
synced 2026-02-10 02:33:02 +01:00
package.bbclass: fix python unclosed file ResourceWarning
Fix the following warning. ResourceWarning: unclosed file <_io.TextIOWrapper name='/.../systemd/1_239-r0/debugsources.list' mode='a' encoding='UTF-8'> (From OE-Core rev: 91810a57f0edd8b37c5f3f989a5aca69d9a40b37) (From OE-Core rev: 284252d1b6d1672a5b6c042fa591f00d89613a22) 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> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -368,7 +368,8 @@ def append_source_info(file, sourcefile, d, fatal=True):
|
||||
# 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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user