Is there a way to ensure that some cleanup code will get run whenever my process terminates?
I've tried signal and try:finally:, while noting that, e.g., atexit says it doesn't handle interrupts. I can catch many circumstances, but if I kill the process from task manager my cleanup doesn't happen (at least, print "I'm cleaning up" doesn't come out). I don't see anything in win32api that looks appropriate, and I don't know if Windows provides any sure way to do what I want. There is a call to handle some very abnormal exits, but they are sufficiently bad that, like SIGSEGV, I don't want to run the cleanup code (even if I can). The process will eventually run as a service. I assume there is some protocol for managing normal service control manager requests to start and stop. Thanks for any pointers. Ross Boylan _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32