diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-12-18 14:53:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-06 16:38:30 +0000 |
commit | f6d2003f09cc76d5ba2de42d68cb0cf4035bdb22 (patch) | |
tree | d889bb61b573d7374cdb2bf24b01b9f1dbe18c6a /meta | |
parent | 5646749d60b003b30d30d68c342eefb513dd8373 (diff) | |
download | poky-f6d2003f09cc76d5ba2de42d68cb0cf4035bdb22.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: 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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index d1e9138c66..0fe9576b4d 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 | ||