Nest try/except/finally for python2.4 compatibility

As long as we support EL5, we've gotta support python 2.4