summaryrefslogtreecommitdiffstats
path: root/pre_commit/languages/ruby.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-11 08:29:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-11 08:29:45 +0000
commitbfb804ed317bbbd1e0089c80c1b1d3510185bca6 (patch)
tree93ee86b21565e569256a09e651a10c08befcd4b8 /pre_commit/languages/ruby.py
parentAdding upstream version 3.5.0. (diff)
downloadpre-commit-bfb804ed317bbbd1e0089c80c1b1d3510185bca6.tar.xz
pre-commit-bfb804ed317bbbd1e0089c80c1b1d3510185bca6.zip
Adding upstream version 3.6.0.upstream/3.6.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/languages/ruby.py')
-rw-r--r--pre_commit/languages/ruby.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pre_commit/languages/ruby.py b/pre_commit/languages/ruby.py
index c88269f..0438ae0 100644
--- a/pre_commit/languages/ruby.py
+++ b/pre_commit/languages/ruby.py
@@ -6,9 +6,9 @@ import importlib.resources
import os.path
import shutil
import tarfile
-from typing import Generator
+from collections.abc import Generator
+from collections.abc import Sequence
from typing import IO
-from typing import Sequence
import pre_commit.constants as C
from pre_commit import lang_base
@@ -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)