summaryrefslogtreecommitdiff
path: root/git/exc.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-05-17 13:11:57 +0100
committerYobmod <yobmod@gmail.com>2021-05-17 13:11:57 +0100
commit025fe17da390c410e5bae4d6db0832afbfa26442 (patch)
tree677816fde797686f6ae07923e9a8698231a6fe28 /git/exc.py
parent595181da70978ed44983a6c0ca4cb6d982ba0e8b (diff)
downloadgitpython-025fe17da390c410e5bae4d6db0832afbfa26442.tar.gz
add types to index.fun.py
Diffstat (limited to 'git/exc.py')
-rw-r--r--git/exc.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/git/exc.py b/git/exc.py
index 54a1d51b..e8ff784c 100644
--- a/git/exc.py
+++ b/git/exc.py
@@ -11,7 +11,7 @@ from git.compat import safe_decode
# typing ----------------------------------------------------
-from typing import List, Optional, Sequence, Tuple, Union, TYPE_CHECKING
+from typing import List, Sequence, Tuple, Union, TYPE_CHECKING
from git.types import PathLike
if TYPE_CHECKING:
@@ -113,7 +113,7 @@ class CheckoutError(GitError):
were checked out successfully and hence match the version stored in the
index"""
- def __init__(self, message: str, failed_files: Sequence[PathLike], valid_files: List[PathLike],
+ def __init__(self, message: str, failed_files: Sequence[PathLike], valid_files: Sequence[PathLike],
failed_reasons: List[str]) -> None:
Exception.__init__(self, message)
@@ -139,8 +139,11 @@ class HookExecutionError(CommandError):
"""Thrown if a hook exits with a non-zero exit code. It provides access to the exit code and the string returned
via standard output"""
- def __init__(self, command: Union[List[str], Tuple[str, ...], str], status: Optional[str],
- stderr: Optional[str] = None, stdout: Optional[str] = None) -> None:
+ def __init__(self, command: Union[List[str], Tuple[str, ...], str],
+ status: Union[str, int, None, Exception],
+ stderr: Union[bytes, str, None] = None,
+ stdout: Union[bytes, str, None] = None) -> None:
+
super(HookExecutionError, self).__init__(command, status, stderr, stdout)
self._msg = "Hook('%s') failed%s"