, exceptions, signals, exceptions. KeyboardInterrupt - , signal.SIGINT ( Ctrl + C).
exceptions , , ? , ('', 'r'), file , , open IOError Exception, mask . , .
- ,
KeyboardInterrupt , , , signal, KeyboardInterrupt.
mask Unix, Python 3.3, signal.pthread_sigmask []
context expression , - mask , , , unmask , ( , ) -
import signal
signal.pthread_sigmask(signal.SIG_BLOCK,[signal.SIGINT])
with <context expression> as variable:
signal.pthread_sigmask(signal.SIG_UNBLOCK,[signal.SIGINT])
...