summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-10-30 21:45:40 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-10-30 21:45:40 (GMT)
commitaecd3b77184f5a9a16a26cec39a532a50f1ab191 (patch)
tree89b23f4dd7afb461a28c728eb9a138c800c7d867 /Lib
parent046467cf9a5c0a5699d5a11381470076ae2a1c3d (diff)
downloadcpython-aecd3b77184f5a9a16a26cec39a532a50f1ab191.zip
cpython-aecd3b77184f5a9a16a26cec39a532a50f1ab191.tar.gz
cpython-aecd3b77184f5a9a16a26cec39a532a50f1ab191.tar.bz2
Merged revisions 75967 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75967 | antoine.pitrou | 2009-10-30 22:41:22 +0100 (ven., 30 oct. 2009) | 3 lines Try to fix transient refleaks in test_pydoc. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_pydoc.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 76822af..56d125b 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -9,7 +9,8 @@ import inspect
import unittest
import test.support
from contextlib import contextmanager
-from test.support import TESTFN, forget, rmtree, EnvironmentVarGuard
+from test.support import (
+ TESTFN, forget, rmtree, EnvironmentVarGuard, reap_children)
from test import pydoc_mod
@@ -195,8 +196,11 @@ def run_pydoc(module_name, *args):
output of pydoc.
"""
cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
- output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read()
- return output.strip()
+ try:
+ output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
+ return output.strip()
+ finally:
+ reap_children()
def get_pydoc_html(module):
"Returns pydoc generated output as html"