Indeed, this helps! I use a C extension module for some hardware access. I want to (have to!) reinitialize the hardware if the program exits in an unusual way (e.g. keyboard interrupt), and I thought using the destructor of the controlling class to do this job would be the proper way. Thanks!