mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
This commit is contained in:
parent
137ff79329
commit
2b221ed657
1 changed files with 6 additions and 3 deletions
|
@ -30,12 +30,14 @@ class ProcessTestCase(unittest.TestCase):
|
|||
def setUp(self):
|
||||
# Try to minimize the number of children we have so this test
|
||||
# doesn't crash on some buildbots (Alphas in particular).
|
||||
test_support.reap_children()
|
||||
if hasattr(test_support, "reap_children"):
|
||||
test_support.reap_children()
|
||||
|
||||
def tearDown(self):
|
||||
# Try to minimize the number of children we have so this test
|
||||
# doesn't crash on some buildbots (Alphas in particular).
|
||||
test_support.reap_children()
|
||||
if hasattr(test_support, "reap_children"):
|
||||
test_support.reap_children()
|
||||
|
||||
def mkstemp(self):
|
||||
"""wrapper for mkstemp, calling mktemp if mkstemp is not available"""
|
||||
|
@ -610,7 +612,8 @@ class ProcessTestCase(unittest.TestCase):
|
|||
|
||||
def test_main():
|
||||
test_support.run_unittest(ProcessTestCase)
|
||||
test_support.reap_children()
|
||||
if hasattr(test_support, "reap_children"):
|
||||
test_support.reap_children()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue