summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-13 22:43:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-13 22:57:29 +0000
commit6a68c42de08cffbadb59ebda63fa5e19f6e5acef (patch)
treeac72f8149e0a78c92d49b8f5386933281579d678
parentcb49980fa4a158d5529902df731dec61a8c9b3d4 (diff)
downloadopenembedded-core-6a68c42de08cffbadb59ebda63fa5e19f6e5acef.tar.gz
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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/commands.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 0d9cf23fe4..01add68689 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