From 017b0d4b19127868ccb8ee616f64734b48f6e620 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 19 Jul 2021 20:08:07 +0100 Subject: Add a cast to git.cmd _version_info --- git/cmd.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'git') diff --git a/git/cmd.py b/git/cmd.py index 4d0e5cdd..4404981e 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -603,19 +603,19 @@ class Git(LazyMixin): process_version = self._call_process('version') # should be as default *args and **kwargs used version_numbers = process_version.split(' ')[2] - self._version_info: Tuple[int, int, int, int] = tuple( - int(n) for n in version_numbers.split('.')[:4] if n.isdigit() - ) # type: ignore # use typeguard here + self._version_info = cast(Tuple[int, int, int, int], + tuple(int(n) for n in version_numbers.split('.')[:4] if n.isdigit()) + ) else: super(Git, self)._set_cache_(attr) # END handle version info - @property + @ property def working_dir(self) -> Union[None, PathLike]: """:return: Git directory we are working on""" return self._working_dir - @property + @ property def version_info(self) -> Tuple[int, int, int, int]: """ :return: tuple(int, int, int, int) tuple with integers representing the major, minor @@ -623,7 +623,7 @@ class Git(LazyMixin): This value is generated on demand and is cached""" return self._version_info - @overload + @ overload def execute(self, command: Union[str, Sequence[Any]], *, @@ -631,7 +631,7 @@ class Git(LazyMixin): ) -> 'AutoInterrupt': ... - @overload + @ overload def execute(self, command: Union[str, Sequence[Any]], *, @@ -640,7 +640,7 @@ class Git(LazyMixin): ) -> Union[str, Tuple[int, str, str]]: ... - @overload + @ overload def execute(self, command: Union[str, Sequence[Any]], *, @@ -649,7 +649,7 @@ class Git(LazyMixin): ) -> Union[bytes, Tuple[int, bytes, str]]: ... - @overload + @ overload def execute(self, command: Union[str, Sequence[Any]], *, @@ -659,7 +659,7 @@ class Git(LazyMixin): ) -> str: ... - @overload + @ overload def execute(self, command: Union[str, Sequence[Any]], *, -- cgit v1.2.1