diff options
author | Gregory P. Smith <greg@krypto.org> | 2011-03-15 06:15:13 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2011-03-15 06:15:13 (GMT) |
commit | 58e317ba921bf5f9ce18fcf561a11e9b5bd6914c (patch) | |
tree | 260a0f04fab026df0572e4ae43c7de1612f006ee /Lib/test/test_subprocess.py | |
parent | 373089239b26e7445aa44a3501c7056cfa4c3728 (diff) | |
parent | de3909da6b8d09b7bcb142994ebd6daba61a23d3 (diff) | |
download | cpython-58e317ba921bf5f9ce18fcf561a11e9b5bd6914c.zip cpython-58e317ba921bf5f9ce18fcf561a11e9b5bd6914c.tar.gz cpython-58e317ba921bf5f9ce18fcf561a11e9b5bd6914c.tar.bz2 |
merge 1579808ef25b
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 984a879..5e6c40f 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -11,6 +11,7 @@ import re import sysconfig import warnings import select +import shutil try: import gc except ImportError: @@ -546,11 +547,12 @@ class ProcessTestCase(BaseTestCase): else: max_handles = 2050 # too much for (at least some) Windows setups handles = [] + tmpdir = tempfile.mkdtemp() try: for i in range(max_handles): try: - handles.append(os.open(support.TESTFN, - os.O_WRONLY | os.O_CREAT)) + tmpfile = os.path.join(tmpdir, support.TESTFN) + handles.append(os.open(tmpfile, os.O_WRONLY|os.O_CREAT)) except OSError as e: if e.errno != errno.EMFILE: raise @@ -575,6 +577,7 @@ class ProcessTestCase(BaseTestCase): finally: for h in handles: os.close(h) + shutil.rmtree(tmpdir) def test_list2cmdline(self): self.assertEqual(subprocess.list2cmdline(['a b c', 'd', 'e']), |