From: Pablo Galindo Date: Sun, 29 Dec 2019 21:35:54 +0000 (+0000) Subject: bpo-39157: Skip test_pidfd_send_signal if the system does not have enough privileges... X-Git-Tag: v3.9.0a3~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f0703ff92ed2d9ccd52d7e083c7bc26e732a428;p=thirdparty%2FPython%2Fcpython.git bpo-39157: Skip test_pidfd_send_signal if the system does not have enough privileges to use pidfd (GH-17740) --- diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 5c02c28a90e1..5b072b0c60ee 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)