Copy note on using check_signals on non-main thread/interpreter from Python docs.

This commit is contained in:
Adam Reichold 2023-12-22 12:08:37 +01:00 committed by David Hewitt
parent b84271140e
commit ecb0e9cb61
1 changed files with 3 additions and 0 deletions

View File

@ -907,6 +907,9 @@ impl<'py> Python<'py> {
/// As Python's [`signal`][2] API allows users to define custom signal handlers, calling this /// As Python's [`signal`][2] API allows users to define custom signal handlers, calling this
/// function allows arbitrary Python code inside signal handlers to run. /// function allows arbitrary Python code inside signal handlers to run.
/// ///
/// If the function is called from a non-main thread, or under a non-main Python interpreter,
/// it does nothing yet still returns `Ok(())`.
///
/// [1]: https://docs.python.org/3/c-api/exceptions.html?highlight=pyerr_checksignals#c.PyErr_CheckSignals /// [1]: https://docs.python.org/3/c-api/exceptions.html?highlight=pyerr_checksignals#c.PyErr_CheckSignals
/// [2]: https://docs.python.org/3/library/signal.html /// [2]: https://docs.python.org/3/library/signal.html
pub fn check_signals(self) -> PyResult<()> { pub fn check_signals(self) -> PyResult<()> {