@@ -129,6 +129,36 @@ signal_getsignal(PyObject *module, PyObject *arg)
129129 return return_value ;
130130}
131131
132+ PyDoc_STRVAR (signal_strsignal__doc__ ,
133+ "strsignal($module, signalnum, /)\n"
134+ "--\n"
135+ "\n"
136+ "Return the system description of the given signal.\n"
137+ "\n"
138+ "The return values can be such as \"Interrupt\", \"Segmentation fault\", etc.\n"
139+ "Returns None if the signal is not recognized." );
140+
141+ #define SIGNAL_STRSIGNAL_METHODDEF \
142+ {"strsignal", (PyCFunction)signal_strsignal, METH_O, signal_strsignal__doc__},
143+
144+ static PyObject *
145+ signal_strsignal_impl (PyObject * module , int signalnum );
146+
147+ static PyObject *
148+ signal_strsignal (PyObject * module , PyObject * arg )
149+ {
150+ PyObject * return_value = NULL ;
151+ int signalnum ;
152+
153+ if (!PyArg_Parse (arg , "i:strsignal" , & signalnum )) {
154+ goto exit ;
155+ }
156+ return_value = signal_strsignal_impl (module , signalnum );
157+
158+ exit :
159+ return return_value ;
160+ }
161+
132162#if defined(HAVE_SIGINTERRUPT )
133163
134164PyDoc_STRVAR (signal_siginterrupt__doc__ ,
@@ -440,4 +470,4 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
440470#ifndef SIGNAL_PTHREAD_KILL_METHODDEF
441471 #define SIGNAL_PTHREAD_KILL_METHODDEF
442472#endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */
443- /*[clinic end generated code: output=36132f4189381fe0 input=a9049054013a1b77]*/
473+ /*[clinic end generated code: output=7b41486acf93aa8e input=a9049054013a1b77]*/
0 commit comments