mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
This commit is contained in:
parent
b82e17e626
commit
608876b6b1
6 changed files with 59 additions and 13 deletions
|
@ -53,8 +53,12 @@ This module defines the following constants and functions:
|
|||
|
||||
.. function:: interrupt_main()
|
||||
|
||||
Raise a :exc:`KeyboardInterrupt` exception in the main thread. A subthread can
|
||||
use this function to interrupt the main thread.
|
||||
Simulate the effect of a :data:`signal.SIGINT` signal arriving in the main
|
||||
thread. A thread can use this function to interrupt the main thread.
|
||||
|
||||
If :data:`signal.SIGINT` isn't handled by Python (it was set to
|
||||
:data:`signal.SIG_DFL` or :data:`signal.SIG_IGN`), this function does
|
||||
nothing.
|
||||
|
||||
|
||||
.. function:: exit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue