diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-12-18 14:53:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-03 21:16:00 +0000 |
commit | ea915ed419b0a0d52e2c11fc0a6b87b5c057b6fc (patch) | |
tree | 50a4be9a0650cc2557bd5d90a4e44342e59bdc9b /meta | |
parent | cf5f875d569e4a604438ec0a5c13816b00d1b67f (diff) | |
download | poky-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')
-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 | ||