mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-39157: Skip test_pidfd_send_signal if the system does not have enough privileges to use pidfd (GH-17740)
This commit is contained in:
parent
be287c3191
commit
8f0703ff92
1 changed files with 2 additions and 0 deletions
|
@ -1284,6 +1284,8 @@ class PidfdSignalTest(unittest.TestCase):
|
|||
signal.pidfd_send_signal(0, signal.SIGINT)
|
||||
if cm.exception.errno == errno.ENOSYS:
|
||||
self.skipTest("kernel does not support pidfds")
|
||||
elif cm.exception.errno == errno.EPERM:
|
||||
self.skipTest("Not enough privileges to use pidfs")
|
||||
self.assertEqual(cm.exception.errno, errno.EBADF)
|
||||
my_pidfd = os.open(f'/proc/{os.getpid()}', os.O_DIRECTORY)
|
||||
self.addCleanup(os.close, my_pidfd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue