mirror of
https://github.com/python/cpython.git
synced 2024-11-24 08:52:25 +01:00
merge 141bbcb19c06
This commit is contained in:
commit
de3909da6b
@ -11,6 +11,7 @@ import re
|
||||
import sysconfig
|
||||
import warnings
|
||||
import select
|
||||
import shutil
|
||||
try:
|
||||
import gc
|
||||
except ImportError:
|
||||
@ -488,11 +489,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
|
||||
@ -517,6 +519,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']),
|
||||
|
Loading…
Reference in New Issue
Block a user