diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-04 18:42:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-04 18:42:30 +0000 |
commit | 9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3 (patch) | |
tree | a6d016823a24941dd795d30ba84409db12aa41cb /pre_commit/prefix.py | |
parent | Releasing debian version 2.17.0-1. (diff) | |
download | pre-commit-9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3.tar.xz pre-commit-9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3.zip |
Merging upstream version 2.18.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | pre_commit/prefix.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pre_commit/prefix.py b/pre_commit/prefix.py index 0e3ebbd..f1b28c1 100644 --- a/pre_commit/prefix.py +++ b/pre_commit/prefix.py @@ -1,6 +1,7 @@ +from __future__ import annotations + import os.path from typing import NamedTuple -from typing import Tuple class Prefix(NamedTuple): @@ -12,6 +13,6 @@ class Prefix(NamedTuple): def exists(self, *parts: str) -> bool: return os.path.exists(self.path(*parts)) - def star(self, end: str) -> Tuple[str, ...]: + def star(self, end: str) -> tuple[str, ...]: paths = os.listdir(self.prefix_dir) return tuple(path for path in paths if path.endswith(end)) |