summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
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-12-16 14:31:33 +0000
commit01d00cd776b63d8847cad84fc58af576a40601d0 (patch)
tree1be2c2b9abc0db96773ae1ff7afca70f11f4aeca /meta/lib/oeqa/utils
parentf349ec04241b8b556bdb616659183ebf185f9483 (diff)
downloadpoky-01d00cd776b63d8847cad84fc58af576a40601d0.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) (From OE-Core rev: 6a68c42de08cffbadb59ebda63fa5e19f6e5acef) (From OE-Core rev: f65a5fbd4fd13a52b54c808a6f5d2afab426e050) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-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 da705295bc..2e6a2289cd 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -146,6 +146,9 @@ class Command(object):
146 # At this point we know that the process has closed stdout/stderr, so 146 # At this point we know that the process has closed stdout/stderr, so
147 # it is safe and necessary to wait for the actual process completion. 147 # it is safe and necessary to wait for the actual process completion.
148 self.status = self.process.wait() 148 self.status = self.process.wait()
149 self.process.stdout.close()
150 if self.process.stderr:
151 self.process.stderr.close()
149 152
150 self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status)) 153 self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status))
151 # logging the complete output is insane 154 # logging the complete output is insane