diff options
Diffstat (limited to 'Lib/packaging/tests/test_command_build_scripts.py')
-rw-r--r-- | Lib/packaging/tests/test_command_build_scripts.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/packaging/tests/test_command_build_scripts.py b/Lib/packaging/tests/test_command_build_scripts.py index 60d8b68d80..fd3ac246a6 100644 --- a/Lib/packaging/tests/test_command_build_scripts.py +++ b/Lib/packaging/tests/test_command_build_scripts.py @@ -71,11 +71,8 @@ class BuildScriptsTestCase(support.TempdirManager, return expected def write_script(self, dir, name, text): - f = open(os.path.join(dir, name), "w") - try: + with open(os.path.join(dir, name), "w") as f: f.write(text) - finally: - f.close() def test_version_int(self): source = self.mkdtemp() |