]> granicus.if.org Git - python/commitdiff
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support...
authorPeter Astrand <astrand@lysator.liu.se>
Mon, 10 Jul 2006 20:39:49 +0000 (20:39 +0000)
committerPeter Astrand <astrand@lysator.liu.se>
Mon, 10 Jul 2006 20:39:49 +0000 (20:39 +0000)
Lib/test/test_subprocess.py

index 91257a7996d1c9376ca72e8bce45804060a1a032..483e202410a7dab4c3c65c04e25c69327eb62a5d 100644 (file)
@@ -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()