Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.

This commit is contained in:
Peter Astrand 2006-06-22 20:06:46 +00:00
parent 978ec9a89f
commit d6b2430b7a
1 changed files with 2 additions and 1 deletions

View File

@ -384,7 +384,8 @@ class ProcessTestCase(unittest.TestCase):
def test_no_leaking(self):
# Make sure we leak no resources
if test_support.is_resource_enabled("subprocess") and not mswindows:
if not hasattr(test_support, "is_resource_enabled") \
or test_support.is_resource_enabled("subprocess") and not mswindows:
max_handles = 1026 # too much for most UNIX systems
else:
max_handles = 65