8000 gh-117764: Add signatures for functions in the faulthandler module (G… · python/cpython@245e426 · GitHub
[go: up one dir, main page]

Skip to content

Commit 245e426

Browse files
gh-117764: Add signatures for functions in the faulthandler module (GH-117771)
1 parent 2e098ab commit 245e426

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

Modules/faulthandler.c

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,58 +1192,67 @@ PyDoc_STRVAR(module_doc,
11921192
static PyMethodDef module_methods[] = {
11931193
{"enable",
11941194
_PyCFunction_CAST(faulthandler_py_enable), METH_VARARGS|METH_KEYWORDS,
1195-
PyDoc_STR("enable(file=sys.stderr, all_threads=True): "
1196-
"enable the fault handler")},
1195+
PyDoc_STR("enable($module, /, file=sys.stderr, all_threads=True)\n--\n\n"
1196+
"Enable the fault handler.")},
11971197
{"disable", faulthandler_disable_py, METH_NOARGS,
1198-
PyDoc_STR("disable(): disable the fault handler")},
1198+
PyDoc_STR("disable($module, /)\n--\n\n"
1199+
"Disable the fault handler.")},
11991200
{"is_enabled", faulthandler_is_enabled, METH_NOARGS,
1200-
PyDoc_STR("is_enabled()->bool: check if the handler is enabled")},
1201+
PyDoc_STR("is_enabled($module, /)\n--\n\n"
1202+
"Check if the handler is enabled.")},
12011203
{"dump_traceback",
12021204
_PyCFunction_CAST(faulthandler_dump_traceback_py), METH_VARARGS|METH_KEYWORDS,
1203-
PyDoc_STR("dump_traceback(file=sys.stderr, all_threads=True): "
1204-
"dump the traceback of the current thread, or of all threads "
1205-
"if all_threads is True, into file")},
1205+
PyDoc_STR("dump_traceback($module, /, file=sys.stderr, all_threads=True)\n--\n\n"
1206+
"Dump the traceback of the current thread, or of all threads "
1207+
"if all_threads is True, into file.")},
12061208
{"dump_traceback_later",
12071209
_PyCFunction_CAST(faulthandler_dump_traceback_later), METH_VARARGS|METH_KEYWORDS,
1208-
PyDoc_STR("dump_traceback_later(timeout, repeat=False, file=sys.stderr, exit=False):\n"
1209-
"dump the traceback of all threads in timeout seconds,\n"
1210+
PyDoc_STR("dump_traceback_later($module, /, timeout, repeat=False, file=sys.stderr, exit=False)\n--\n\n"
1211+
"Dump the traceback of all threads in timeout seconds,\n"
12101212
"or each timeout seconds if repeat is True. If exit is True, "
12111213
"call _exit(1) which is not safe.")},
12121214
{"cancel_dump_traceback_later",
12131215
faulthandler_cancel_dump_traceback_later_py, METH_NOARGS,
1214-
PyDoc_STR("cancel_dump_traceback_later():\ncancel the previous call "
1215-
"to dump_traceback_later().")},
1216+
PyDoc_STR("cancel_dump_traceback_later($module, /)\n--\n\n"
1217+
"Cancel the previous call to dump_traceback_later().")},
12161218
#ifdef FAULTHANDLER_USER
12171219
{"register",
12181220
_PyCFunction_CAST(faulthandler_register_py), METH_VARARGS|METH_KEYWORDS,
1219-
PyDoc_STR("register(signum, file=sys.stderr, all_threads=True, chain=False): "
1220-
"register a handler for the signal 'signum': dump the "
1221+
PyDoc_STR("register($module, /, signum, file=sys.stderr, all_threads=True, chain=False)\n--\n\n"
1222+
"Register a handler for the signal 'signum': dump the "
12211223
"traceback of the current thread, or of all threads if "
1222-
"all_threads is True, into file")},
1224+
"all_threads is True, into file.")},
12231225
{"unregister",
1224-
_PyCFunction_CAST(faulthandler_unregister_py), METH_VARARGS|METH_KEYWORDS,
1225-
PyDoc_STR("unregister(signum): unregister the handler of the signal "
1226-
"'signum' registered by register()")},
1226+
_PyCFunction_CAST(faulthandler_unregister_py), METH_VARARGS,
1227+
PyDoc_STR("unregister($module, signum, /)\n--\n\n"
1228+
"Unregister the handler of the signal "
1229+
"'signum' registered by register().")},
12271230
#endif
12281231
{"_read_null", faulthandler_read_null, METH_NOARGS,
1229-
PyDoc_STR("_read_null(): read from NULL, raise "
1230-
"a SIGSEGV or SIGBUS signal depending on the platform")},
1232+
PyDoc_STR("_read_null($module, /)\n--\n\n"
1233+
"Read from NULL, raise "
1234+
"a SIGSEGV or SIGBUS signal depending on the platform.")},
12311235
{"_sigsegv", faulthandler_sigsegv, METH_VARARGS,
1232-
PyDoc_STR("_sigsegv(release_gil=False): raise a SIGSEGV signal")},
1236+
PyDoc_STR("_sigsegv($module, release_gil=False, /)\n--\n\n"
1237+
"Raise a SIGSEGV signal.")},
12331238
{"_fatal_error_c_thread", faulthandler_fatal_error_c_thread, METH_NOARGS,
1234-
PyDoc_STR("fatal_error_c_thread(): "
1235-
"call Py_FatalError() in a new C thread.")},
1239+
PyDoc_STR("_fatal_error_c_thread($module, /)\n--\n\n"
1240+
"Call Py_FatalError() in a new C thread.")},
12361241
{"_sigabrt", faulthandler_sigabrt, METH_NOARGS,
1237-
PyDoc_STR("_sigabrt(): raise a SIGABRT signal")},
1242+
PyDoc_STR("_sigabrt($module, /)\n--\n\n"
1243+
"Raise a SIGABRT signal.")},
12381244
{"_sigfpe", (PyCFunction)faulthandler_sigfpe, METH_NOARGS,
1239-
PyDoc_STR("_sigfpe(): raise a SIGFPE signal")},
1245+
PyDoc_STR("_sigfpe($module, /)\n--\n\n"
1246+
"Raise a SIGFPE signal.")},
12401247
#ifdef FAULTHANDLER_STACK_OVERFLOW
12411248
{"_stack_overflow", faulthandler_stack_overflow, METH_NOARGS,
1242-
PyDoc_STR("_stack_overflow(): recursive call to raise a stack overflow")},
1249+
PyDoc_STR("_stack_overflow($module, /)\n--\n\n"
1250+
"Recursive call to raise a stack overflow.")},
12431251
#endif
12441252
#ifdef MS_WINDOWS
12451253
{"_raise_exception", faulthandler_raise_exception, METH_VARARGS,
1246-
PyDoc_STR("raise_exception(code, flags=0): Call RaiseException(code, flags).")},
1254+
PyDoc_STR("_raise_exception($module, code, flags=0, /)\n--\n\n"
1255+
"Call RaiseException(code, flags).")},
12471256
#endif
12481257
{NULL, NULL} /* sentinel */
12491258
};

0 commit comments

Comments
 (0)
0