Don't forget to close an open file
@@ -1321,7 +1321,8 @@ def test_cleanup_after_failed_wheel(script, with_wheel):
# One of the effects of not cleaning up is broken scripts:
script_py = script.bin_path / "script.py"
assert script_py.exists(), script_py
- shebang = open(script_py).readline().strip()
+ with open(script_py) as f:
+ shebang = f.readline().strip()
assert shebang != '#!python', shebang
# OK, assert that we *said* we were cleaning up:
# /!\ if in need to change this, also change test_pep517_no_legacy_cleanup
