mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-98930: improve the docstring of signal.strsignal (GH-99290) (#99449)
Improves the docstring on signal.strsignal to make it explain when it returns a message, None, or when it raises ValueError.
Closes GH-98930
Co-authored-by: Gregory P. Smith <greg@krypto.org>.
(cherry picked from commit 88385b8564
)
Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
This commit is contained in:
parent
bf76d9bd4d
commit
51c68cf466
3 changed files with 11 additions and 9 deletions
|
@ -627,13 +627,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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue