
Sept. 14, 2009
3:12 a.m.
Steven D'Aprano wrote:
You can kill an unresponsive Python program from the outside, (say) with ctrl-\, and the finally clause never executes:
Yes, but you expect that signal to kill the process immediately without bothering with any cleanup. Ctrl-C, on the other hand, is meant to be a graceful request to terminate cleanly. In the context of Python, one can reasonably expect that to include execution of finally blocks. -- Greg