summaryrefslogtreecommitdiffstats
path: root/pre_commit/util.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:32:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:32:22 +0000
commitd7784aa0c412c80cfcb33a29fd1b2ea69dbe8ab8 (patch)
treef7d340787b36afcb3b78f2a0875c2c9c8419cdec /pre_commit/util.py
parentReleasing debian version 3.0.4-1. (diff)
downloadpre-commit-d7784aa0c412c80cfcb33a29fd1b2ea69dbe8ab8.tar.xz
pre-commit-d7784aa0c412c80cfcb33a29fd1b2ea69dbe8ab8.zip
Merging upstream version 3.1.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/util.py')
-rw-r--r--pre_commit/util.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/pre_commit/util.py b/pre_commit/util.py
index 8ea4844..ea0d4f5 100644
--- a/pre_commit/util.py
+++ b/pre_commit/util.py
@@ -12,7 +12,6 @@ from types import TracebackType
from typing import Any
from typing import Callable
from typing import Generator
-from typing import IO
from pre_commit import parse_shebang
@@ -36,10 +35,6 @@ def clean_path_on_failure(path: str) -> Generator[None, None, None]:
raise
-def resource_bytesio(filename: str) -> IO[bytes]:
- return importlib.resources.open_binary('pre_commit.resources', filename)
-
-
def resource_text(filename: str) -> str:
return importlib.resources.read_text('pre_commit.resources', filename)
@@ -67,7 +62,7 @@ class CalledProcessError(RuntimeError):
def __bytes__(self) -> bytes:
def _indent_or_none(part: bytes | None) -> bytes:
if part:
- return b'\n ' + part.replace(b'\n', b'\n ')
+ return b'\n ' + part.replace(b'\n', b'\n ').rstrip()
else:
return b' (none)'