Commit de3909da authored by Gregory P. Smith's avatar Gregory P. Smith

merge 141bbcb19c06

parents 4969f709 81ce6859
...@@ -11,6 +11,7 @@ import re ...@@ -11,6 +11,7 @@ import re
import sysconfig import sysconfig
import warnings import warnings
import select import select
import shutil
try: try:
import gc import gc
except ImportError: except ImportError:
...@@ -488,11 +489,12 @@ class ProcessTestCase(BaseTestCase): ...@@ -488,11 +489,12 @@ class ProcessTestCase(BaseTestCase):
else: else:
max_handles = 2050 # too much for (at least some) Windows setups max_handles = 2050 # too much for (at least some) Windows setups
handles = [] handles = []
tmpdir = tempfile.mkdtemp()
try: try:
for i in range(max_handles): for i in range(max_handles):
try: try:
handles.append(os.open(support.TESTFN, tmpfile = os.path.join(tmpdir, support.TESTFN)
os.O_WRONLY | os.O_CREAT)) handles.append(os.open(tmpfile, os.O_WRONLY|os.O_CREAT))
except OSError as e: except OSError as e:
if e.errno != errno.EMFILE: if e.errno != errno.EMFILE:
raise raise
...@@ -517,6 +519,7 @@ class ProcessTestCase(BaseTestCase): ...@@ -517,6 +519,7 @@ class ProcessTestCase(BaseTestCase):
finally: finally:
for h in handles: for h in handles:
os.close(h) os.close(h)
shutil.rmtree(tmpdir)
def test_list2cmdline(self): def test_list2cmdline(self):
self.assertEqual(subprocess.list2cmdline(['a b c', 'd', 'e']), self.assertEqual(subprocess.list2cmdline(['a b c', 'd', 'e']),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment