mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Try to fix transient refleaks in test_pydoc.
This commit is contained in:
parent
3c96858480
commit
161df94b0d
1 changed files with 7 additions and 3 deletions
|
@ -9,7 +9,8 @@ import inspect
|
||||||
import unittest
|
import unittest
|
||||||
import test.test_support
|
import test.test_support
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from test.test_support import TESTFN, forget, rmtree, EnvironmentVarGuard
|
from test.test_support import (
|
||||||
|
TESTFN, forget, rmtree, EnvironmentVarGuard, reap_children)
|
||||||
|
|
||||||
from test import pydoc_mod
|
from test import pydoc_mod
|
||||||
|
|
||||||
|
@ -178,8 +179,11 @@ def run_pydoc(module_name, *args):
|
||||||
output of pydoc.
|
output of pydoc.
|
||||||
"""
|
"""
|
||||||
cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
|
cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
|
||||||
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read()
|
try:
|
||||||
return output.strip()
|
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
|
||||||
|
return output.strip()
|
||||||
|
finally:
|
||||||
|
reap_children()
|
||||||
|
|
||||||
def get_pydoc_html(module):
|
def get_pydoc_html(module):
|
||||||
"Returns pydoc generated output as html"
|
"Returns pydoc generated output as html"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue