Can we use the with statement here, so we don't have to use the try, finally pattern below?