[Tutor] UPDATE: Is there a 'hook' to capture all exits from a python program?

Alan Gauld alan.gauld at btinternet.com
Fri Mar 20 21:35:34 CET 2015


On 20/03/15 20:04, Albert-Jan Roskam wrote:

>> (BTW Does anyone know what the interpreter does when
>> suspending - Ctrl-Z in Unix land?)
>
> No experience with it, but I would first check the 'signal' module

Yeah, I know you can catch a signal and add your own handler, but I 
meant what is the default Python suspend behaviour? Does it execute any 
outstanding exception blocks? What about finally blocks? Or, if about to 
exit a context manager, the __exit__ method?

Or does it just stop and wait till its resumed? Kind of like
an implicit yield statement?


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list