From 56fc6c3955f504a7b51b7d6de31cc8efe930ef72 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 12 Jul 2018 01:33:36 +0000 Subject: [PATCH] Close popen stdout and stderr They should get cleaned up anyway, but Python 3 gives us an error message. This silences it. --- mininet/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mininet/util.py b/mininet/util.py index 3b80f58..1269410 100644 --- a/mininet/util.py +++ b/mininet/util.py @@ -130,6 +130,10 @@ def errRun( *cmd, **kwargs ): poller.unregister( fd ) returncode = popen.wait() + # Python 3 complains if we don't explicitly close these + popen.stdout.close() + if stderr == PIPE: + popen.stderr.close() debug( out, err, returncode ) return out, err, returncode # pylint: enable=too-many-branches