summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_signal.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-12-29 21:35:54 (GMT)
committerGitHub <noreply@github.com>2019-12-29 21:35:54 (GMT)
commit8f0703ff92ed2d9ccd52d7e083c7bc26e732a428 (patch)
tree9bafd7d66976f8736c42326459b1f51be08dcbb7 /Lib/test/test_signal.py
parentbe287c319124b7eb59ef32b69cf837ae3e99acab (diff)
downloadcpython-8f0703ff92ed2d9ccd52d7e083c7bc26e732a428.zip
cpython-8f0703ff92ed2d9ccd52d7e083c7bc26e732a428.tar.gz
cpython-8f0703ff92ed2d9ccd52d7e083c7bc26e732a428.tar.bz2
bpo-39157: Skip test_pidfd_send_signal if the system does not have enough privileges to use pidfd (GH-17740)
Diffstat (limited to 'Lib/test/test_signal.py')
-rw-r--r--Lib/test/test_signal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 5c02c28..5b072b0 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -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)