[OE-core] [PATCH 10/45] oeqa/utils/qemurunner: Fix python ResourceWarning for unclosed file
Armin Kuster
akuster808 at gmail.com
Thu Dec 13 21:38:18 UTC 2018
From: Richard Purdie <richard.purdie at linuxfoundation.org>
Fixes:
Stderr:
/media/build1/poky/meta/lib/oeqa/utils/qemurunner.py:381: ResourceWarning: unclosed file <_io.BufferedWriter name=16>
self.runqemu = None
(From OE-Core rev: b9e0bf919e6fc1a58e02145a363ebe7066e5bf4f)
(From OE-Core rev: b8a9eec2c9e56181350269acd6b42a14cc4abb3e)
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/utils/qemurunner.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c962602..983c8c7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -369,6 +369,8 @@ class QemuRunner:
if self.runqemu.poll() is None:
self.logger.debug("Sending SIGKILL to runqemu")
os.killpg(os.getpgid(self.runqemu.pid), signal.SIGKILL)
+ self.runqemu.stdin.close()
+ self.runqemu.stdout.close()
self.runqemu = None
if hasattr(self, 'server_socket') and self.server_socket:
self.server_socket.close()
--
2.7.4
More information about the Openembedded-core
mailing list