Ensure file handle is closed by using with statement
Merge pull request #177 from michaelrice/setup_patch

Ensure file handle is closed by using with statement