diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-13 22:43:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-06 10:21:43 +0000 |
commit | f65a5fbd4fd13a52b54c808a6f5d2afab426e050 (patch) | |
tree | f43dacc20dc0a218b01477450c3b68f3dbe7d886 /meta/lib | |
parent | bb2cddb08d7c4c6c56dfe6b2f0d26dce1cdf20e4 (diff) | |
download | openembedded-core-f65a5fbd4fd13a52b54c808a6f5d2afab426e050.tar.gz openembedded-core-f65a5fbd4fd13a52b54c808a6f5d2afab426e050.tar.bz2 openembedded-core-f65a5fbd4fd13a52b54c808a6f5d2afab426e050.zip |
oeqa/utils/commands: Avoid unclosed file warnings
Avoid warnings such as:
meta/lib/oeqa/utils/commands.py:213: ResourceWarning: unclosed file <_io.BufferedReader name=4>
return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)
(From OE-Core rev: 6a68c42de08cffbadb59ebda63fa5e19f6e5acef)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index da705295bc..2e6a2289cd 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -146,6 +146,9 @@ class Command(object): # At this point we know that the process has closed stdout/stderr, so # it is safe and necessary to wait for the actual process completion. self.status = self.process.wait() + self.process.stdout.close() + if self.process.stderr: + self.process.stderr.close() self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status)) # logging the complete output is insane |