mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 10:01:46 +04:00
Fix several ResourceWarning: unclosed file
This commit is contained in:
parent
abee146199
commit
67d6fcb0f6
10 changed files with 78 additions and 34 deletions
|
|
@ -415,7 +415,8 @@ def test_replace_old_commit_script(tempdir_factory, store):
|
|||
runner = Runner(path, C.CONFIG_FILE)
|
||||
|
||||
# Install a script that looks like our old script
|
||||
pre_commit_contents = io.open(resource_filename('hook-tmpl')).read()
|
||||
with io.open(resource_filename('hook-tmpl')) as f:
|
||||
pre_commit_contents = f.read()
|
||||
new_contents = pre_commit_contents.replace(
|
||||
CURRENT_HASH, PRIOR_HASHES[-1],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue