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

@ -25,7 +25,8 @@ run_hook = lang_base.basic_run_hook
def _resource_bytesio(filename: str) -> IO[bytes]:
return importlib.resources.open_binary('pre_commit.resources', filename)
files = importlib.resources.files('pre_commit.resources')
return files.joinpath(filename).open('rb')
@functools.lru_cache(maxsize=1)