3.13 removed the simpler importlib.resources api

This commit is contained in:
Anthony Sottile 2023-10-28 14:39:49 -04:00 committed by Vyacheslav Kapitonov
parent c4042d0a58
commit 4bb30d6e0b
2 changed files with 4 additions and 2 deletions

View file

@ -36,7 +36,8 @@ def clean_path_on_failure(path: str) -> Generator[None, None, None]:
def resource_text(filename: str) -> str:
return importlib.resources.read_text('pre_commit.resources', filename)
files = importlib.resources.files('pre_commit.resources')
return files.joinpath(filename).read_text()
def make_executable(filename: str) -> None: