mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
Issue #25764: Merge fix for root user from 3.5
This commit is contained in:
commit
aa5dcd893c
1 changed files with 6 additions and 2 deletions
|
@ -1525,10 +1525,14 @@ class POSIXProcessTestCase(BaseTestCase):
|
||||||
[_, hard] = limits
|
[_, hard] = limits
|
||||||
setrlimit(RLIMIT_NPROC, (0, hard))
|
setrlimit(RLIMIT_NPROC, (0, hard))
|
||||||
self.addCleanup(setrlimit, RLIMIT_NPROC, limits)
|
self.addCleanup(setrlimit, RLIMIT_NPROC, limits)
|
||||||
# Forking should raise EAGAIN, translated to BlockingIOError
|
try:
|
||||||
with self.assertRaises(BlockingIOError):
|
|
||||||
subprocess.call([sys.executable, '-c', ''],
|
subprocess.call([sys.executable, '-c', ''],
|
||||||
preexec_fn=lambda: None)
|
preexec_fn=lambda: None)
|
||||||
|
except BlockingIOError:
|
||||||
|
# Forking should raise EAGAIN, translated to BlockingIOError
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.skipTest('RLIMIT_NPROC had no effect; probably superuser')
|
||||||
|
|
||||||
def test_args_string(self):
|
def test_args_string(self):
|
||||||
# args is a string
|
# args is a string
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue