summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorram vikram singh <ramvikrams243@gmail.com>2022-11-13 19:41:23 (GMT)
committerGitHub <noreply@github.com>2022-11-13 19:41:23 (GMT)
commit88385b856490a5ce3c99160bde6050638f81f72e (patch)
treee020f1630cf7d9f597fc280ccc9f724c32d8dc21 /Modules/signalmodule.c
parent343eb0f94b26f2a4c1c15505d417e8157ec19660 (diff)
downloadcpython-88385b856490a5ce3c99160bde6050638f81f72e.zip
cpython-88385b856490a5ce3c99160bde6050638f81f72e.tar.gz
cpython-88385b856490a5ce3c99160bde6050638f81f72e.tar.bz2
gh-98930: improve the docstring of signal.strsignal (#99290)
Improves the docstring on signal.strsignal to make it explain when it returns a message, None, or when it raises ValueError. Closes #98930 Co-authored-by: Gregory P. Smith <greg@krypto.org>
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index bdd3f4b..c539787 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -626,13 +626,14 @@ signal.strsignal
Return the system description of the given signal.
-The return values can be such as "Interrupt", "Segmentation fault", etc.
-Returns None if the signal is not recognized.
+Returns the description of signal *signalnum*, such as "Interrupt"
+for :const:`SIGINT`. Returns :const:`None` if *signalnum* has no
+description. Raises :exc:`ValueError` if *signalnum* is invalid.
[clinic start generated code]*/
static PyObject *
signal_strsignal_impl(PyObject *module, int signalnum)
-/*[clinic end generated code: output=44e12e1e3b666261 input=b77914b03f856c74]*/
+/*[clinic end generated code: output=44e12e1e3b666261 input=238b335847778bc0]*/
{
const char *res;