summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-12-18 06:53:43 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-03 21:16:00 (GMT)
commitea915ed419b0a0d52e2c11fc0a6b87b5c057b6fc (patch)
tree50a4be9a0650cc2557bd5d90a4e44342e59bdc9b /meta/classes/package.bbclass
parentcf5f875d569e4a604438ec0a5c13816b00d1b67f (diff)
downloadpoky-ea915ed419b0a0d52e2c11fc0a6b87b5c057b6fc.tar.gz
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) 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>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index d1e9138..0fe9576 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -368,7 +368,8 @@ def append_source_info(file, sourcefile, d, fatal=True):
368 # is still assuming that. 368 # is still assuming that.
369 debuglistoutput = '\0'.join(debugsources) + '\0' 369 debuglistoutput = '\0'.join(debugsources) + '\0'
370 lf = bb.utils.lockfile(sourcefile + ".lock") 370 lf = bb.utils.lockfile(sourcefile + ".lock")
371 open(sourcefile, 'a').write(debuglistoutput) 371 with open(sourcefile, 'a') as sf:
372 sf.write(debuglistoutput)
372 bb.utils.unlockfile(lf) 373 bb.utils.unlockfile(lf)
373 374
374 375