Re: [python-win32] Guaranteed cleanup code execution?

2010-01-13 Thread Gabriel Genellina
En Mon, 11 Jan 2010 23:33:23 -0300, Mario Alejandro Vilas Jerez mvi...@gmail.com escribió: But what I think you're really looking for is the Service Control Manager: http://msdn.microsoft.com/en-us/library/ms685150(VS.85).aspx The ControlService API lets you stop services (among other

[python-win32] Guaranteed cleanup code execution?

2010-01-11 Thread Ross Boylan
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

Re: [python-win32] Guaranteed cleanup code execution?

2010-01-11 Thread Mario Alejandro Vilas Jerez
If your process is being terminated forcefully (like from the task manager) then you probably don't want to run any cleanup code. If you really must you could code something in C, put it in a DLL library and have it executed in DllMain when the library is unloaded. (And I think you'll still have