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-28 16:56:28 +0000 |
commit | 284252d1b6d1672a5b6c042fa591f00d89613a22 (patch) | |
tree | 2490f73df73bf79b0a31b4d480fadcf9216476e2 /meta/classes | |
parent | f57d83c72b5f53fb10bc8377862668580d331a8c (diff) | |
download | openembedded-core-284252d1b6d1672a5b6c042fa591f00d89613a22.tar.gz openembedded-core-284252d1b6d1672a5b6c042fa591f00d89613a22.tar.bz2 openembedded-core-284252d1b6d1672a5b6c042fa591f00d89613a22.zip |
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>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta/classes')
-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): # 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) |