"""This is a convenient way to deeply nest try/finally statements.""" __docformat__ = "restructuredtext" # Created: Tue Oct 11 08:42:23 PDT 2005 # Author: Shannon -jj Behrens # Email: firstname.lastname@example.org # # Copyright (c) Shannon -jj Behrens. All rights reserved. from traceback import print_exc def tryFinally(tasks, handleFinallyException=None): """This is a convenient way to deeply nest try/finally statements. It is appropriate for complicated resource initialization and destruction. For instance, if you have a list of 50 things that need to get intialized and later destructed via using try/finally (especially if you need to create the list dynamically) this function is appropriate. Given:: tasks = [ ((f_enter_0, enter_0_args, enter_0_kargs), (f_exit_0, exit_0_args, exit_0_kargs)), ((f_enter_1, enter_1_args, enter_1_kargs), (f_exi
Ad maiorem Dei gloriam inque hominum salutem.