mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Replace resources with importlib_resources
This commit is contained in:
parent
ebe5132576
commit
9f60561d6f
17 changed files with 72 additions and 49 deletions
|
|
@ -12,7 +12,7 @@ from pre_commit.repository import repositories
|
|||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import make_executable
|
||||
from pre_commit.util import mkdirp
|
||||
from pre_commit.util import resource_filename
|
||||
from pre_commit.util import resource_text
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -80,8 +80,7 @@ def install(
|
|||
}
|
||||
|
||||
with io.open(hook_path, 'w') as hook_file:
|
||||
with io.open(resource_filename('hook-tmpl')) as f:
|
||||
contents = f.read()
|
||||
contents = resource_text('hook-tmpl')
|
||||
before, rest = contents.split(TEMPLATE_START)
|
||||
to_template, after = rest.split(TEMPLATE_END)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue