try finally in python