diff options
author | Peter Astrand <astrand@lysator.liu.se> | 2006-07-10 20:39:49 (GMT) |
---|---|---|
committer | Peter Astrand <astrand@lysator.liu.se> | 2006-07-10 20:39:49 (GMT) |
commit | 2b221ed6577809c4cc5cfd53963651af247cf546 (patch) | |
tree | c5580c13b3386bc036a7d7961c26a9fa97f7b66c /Lib/test/test_subprocess.py | |
parent | 137ff79329ceefa9f7318c3bb97277627866c2ac (diff) | |
download | cpython-2b221ed6577809c4cc5cfd53963651af247cf546.zip cpython-2b221ed6577809c4cc5cfd53963651af247cf546.tar.gz cpython-2b221ed6577809c4cc5cfd53963651af247cf546.tar.bz2 |
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 91257a7..483e202 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -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() |