def do_work(*args, **kwargs): saved = pwd() try: apply(fn, args, kwargs) finally: cd(saved)
def do_work(*args, **kwargs): saved = pwd() try: fn(*args, **kwargs) finally: cd(saved)