summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/tests/test_command_install_scripts.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/packaging/tests/test_command_install_scripts.py')
-rw-r--r--Lib/packaging/tests/test_command_install_scripts.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/packaging/tests/test_command_install_scripts.py b/Lib/packaging/tests/test_command_install_scripts.py
index 08c7338..6452a34 100644
--- a/Lib/packaging/tests/test_command_install_scripts.py
+++ b/Lib/packaging/tests/test_command_install_scripts.py
@@ -38,11 +38,8 @@ class InstallScriptsTestCase(support.TempdirManager,
def write_script(name, text):
expected.append(name)
- f = open(os.path.join(source, name), "w")
- try:
+ with open(os.path.join(source, name), "w") as f:
f.write(text)
- finally:
- f.close()
write_script("script1.py", ("#! /usr/bin/env python2.3\n"
"# bogus script w/ Python sh-bang\n"