[oe-commits] [openembedded-core] 10/32: oeqa/utils/qemurunner: Fix python ResourceWarning for unclosed file

git at git.openembedded.org git at git.openembedded.org
Thu Dec 6 10:51:41 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch sumo-next
in repository openembedded-core.

commit b8a9eec2c9e56181350269acd6b42a14cc4abb3e
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Nov 28 11:18:30 2018 +0000

    oeqa/utils/qemurunner: Fix python ResourceWarning for unclosed file
    
    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)
    
    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()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list