summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-12-18 14:53:43 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 22:27:45 +0000
commit16c530c0cffe9cee67265d7b69b7973082bcc30a (patch)
tree1eb775d03aa98d69d431c1f5cd72ab9c13a8c800 /meta/classes
parentd668ce8421f21fbf2fdfa7e77ebdef53cb9c74ff (diff)
downloadpoky-16c530c0cffe9cee67265d7b69b7973082bcc30a.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) (From OE-Core rev: f8c111891066609ed40d11fee61ca9e29b5b6029) 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> [Fixup for sumo context] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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 109cf27254..6141a9582d 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -359,7 +359,8 @@ def append_source_info(file, sourcefile, d, fatal=True):
359 # of rpm's debugedit, which was writing them out that way, and the code elsewhere 359 # of rpm's debugedit, which was writing them out that way, and the code elsewhere
360 # is still assuming that. 360 # is still assuming that.
361 debuglistoutput = '\0'.join(debugsources) + '\0' 361 debuglistoutput = '\0'.join(debugsources) + '\0'
362 open(sourcefile, 'a').write(debuglistoutput) 362 with open(sourcefile, 'a') as sf:
363 sf.write(debuglistoutput)
363 364
364 365
365def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d): 366def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):