cpython: a5890ff5e3d5 (original) (raw)

Mercurial > cpython

changeset 69821:a5890ff5e3d5

Issue #8407: signal.pthread_sigmask() returns a set instead of a list Update the doc. Refactor also related tests. [#8407]

Victor Stinner victor.stinner@haypocalc.com
date Wed, 04 May 2011 13:20:35 +0200
parents 88dca05ed468
children be5b8d1ded34
files Doc/library/signal.rst Lib/test/test_signal.py Modules/signalmodule.c
diffstat 3 files changed, 59 insertions(+), 46 deletions(-)[+] [-] Doc/library/signal.rst 7 Lib/test/test_signal.py 33 Modules/signalmodule.c 65

line wrap: on

line diff

--- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -184,7 +184,7 @@ The :mod:signal module defines the fol Fetch and/or change the signal mask of the calling thread. The signal mask is the set of signals whose delivery is currently blocked for the caller.

@@ -196,8 +196,9 @@ The :mod:signal module defines the fol * :data:SIG_SETMASK: The set of blocked signals is set to the mask argument.

--- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -486,24 +486,27 @@ class ItimerTest(unittest.TestCase): @unittest.skipUnless(hasattr(signal, 'pthread_sigmask'), 'need signal.pthread_sigmask()') -class PthreadSigmaskTests(unittest.TestCase):

+class PendingSignalsTests(unittest.TestCase):

+

+

-

- # The fault handler timeout thread masks all signals. If the main # thread masks also SIGUSR1, all threads mask this signal. In this # case, if we send SIGUSR1 to the process, the signal is pending in the @@ -527,7 +530,7 @@ class PthreadSigmaskTests(unittest.TestC "blocked by pthread_sigmask() (issue #11998)") # Install our signal handler

# Unblock SIGUSR1 (and copy the old mask) to test our signal handler @@ -543,9 +546,9 @@ class PthreadSigmaskTests(unittest.TestC os.kill(pid, signum) # Check the new mask

# Unblock SIGUSR1 if can_test_blocked_signals: @@ -558,9 +561,9 @@ class PthreadSigmaskTests(unittest.TestC os.kill(pid, signum) # Check the new mask

@@ -570,7 +573,7 @@ def test_main(): support.run_unittest(BasicSignalTests, InterProcessSignalTests, WakeupSignalTests, SiginterruptTest, ItimerTest, WindowsSignalTests,

--- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -552,11 +552,45 @@ error: return result; } +static PyObject* +sigset_to_set(sigset_t mask) +{

+

+

+

+} + static PyObject * signal_pthread_sigmask(PyObject *self, PyObject *args) {

-

-

} PyDoc_STRVAR(signal_pthread_sigmask_doc,