I am working on a program that needs to call a function right before exiting, and was successfully using atexit.register(myFunction) to do so, until it stopped working. Even when I try running just a simple script, the registered function is not being called...
Here is the simple code:
import atexit def all_done(): print ('all_done()') print ('Registering') atexit.register(all_done) print ('Registered') And the output is:
Registering Registered When it should be:
Registering Registered all_done() What could be the problem? Like I said, it was working for a while, then suddenly stopped.