waiting on an event blocks all signals

Jean-Paul Calderone exarkun at divmod.com
Sat May 17 16:06:23 EDT 2008


On Sat, 17 May 2008 12:49:54 -0700, John Schroeder <jschroed at gmail.com> wrote:
>On Sat, May 17, 2008 at 12:32 PM, alan <alangrow at gmail.com> wrote:
>
>> This ignores CTRL-C on every platform I've tested:
>>
>> python -c "import threading; threading.Event().wait()"
>> ^C^C^C^C
>>
>> It looks to me like all signals are masked before entering wait(). Can
>> someone familiar with the internals explain and/or justify this
>> behavior? Thanks,
>>
>
>^C only kills the main thread.  Use Control-Break to kill all threads.
>

Look at that program.  It's single-threaded.  Where do you think the ^C
is going? :)

Jean-Paul



More information about the Python-list mailing list