summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_poll.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-08-12 11:59:52 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-08-12 11:59:52 (GMT)
commit3cf0b2515ba8cfc855ac9a56a0b4545372157176 (patch)
treecbdcd258f5d83a732c67ce00562847a336301112 /Lib/test/test_poll.py
parentb63c56077ff2e960c17f2d4ae9813b5a12c71130 (diff)
downloadcpython-3cf0b2515ba8cfc855ac9a56a0b4545372157176.zip
cpython-3cf0b2515ba8cfc855ac9a56a0b4545372157176.tar.gz
cpython-3cf0b2515ba8cfc855ac9a56a0b4545372157176.tar.bz2
Issue #26741: Clean up subprocess.Popen object in test_poll
Diffstat (limited to 'Lib/test/test_poll.py')
-rw-r--r--Lib/test/test_poll.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py
index a0a332b..6a2bf6e 100644
--- a/Lib/test/test_poll.py
+++ b/Lib/test/test_poll.py
@@ -125,6 +125,8 @@ class PollTests(unittest.TestCase):
cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
bufsize=0)
+ proc.__enter__()
+ self.addCleanup(proc.__exit__, None, None, None)
p = proc.stdout
pollster = select.poll()
pollster.register( p, select.POLLIN )
@@ -147,7 +149,6 @@ class PollTests(unittest.TestCase):
continue
else:
self.fail('Unexpected return value from select.poll: %s' % fdlist)
- p.close()
def test_poll3(self):
# test int overflow