3 ms·
Python does the right thing under the hood for you. The signal handler you register in Python isn't run in the dangerous context. There's an internal signal han
by whopa 12y ago
Python does the right thing under the hood for you. The signal handler you register in Python isn't run in the dangerous context. There's an internal signal handler which just tells the interpreter a signal happened and when control is returned back to the interpreter outside of the signal handler it knows what to do:
https://hg.python.org/cpython/file/c7d45da654ee/Modules/signalmodule.c#l169 https://hg.python.org/cpython/file/c7d45da654ee/Modules/sign...