Is there a way in python to trigger an action upon exiting a function
Instead of calling that function, make a function that calls both 
-function a (your function)
-function b (the exit function code)
call this meta function instead
I'm in the process of adding a bit of code to a django system that needs to make a specific function call upon exiting a function.  Most of the code that I'm updating has several exit points throughout, which requires that I add a one-liner immediately before each one of them.  A wee bit ugly.
What I'd like to do is to simply say, "upon exiting this function, do this", much like the atexit module (from what I've found so far anyway), but to be triggered upon exiting the function rather than the entire script.
Is there anything I can use that works that way?
(I'm using Python 2.7.3 by the way)