Skip to content

Commit 017b0d4

Browse files
committed
Add a cast to git.cmd _version_info
1 parent 8900f2a commit 017b0d4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: git/cmd.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -603,35 +603,35 @@ def _set_cache_(self, attr: str) -> None:
603603
process_version = self._call_process('version') # should be as default *args and **kwargs used
604604
version_numbers = process_version.split(' ')[2]
605605

606-
self._version_info: Tuple[int, int, int, int] = tuple(
607-
int(n) for n in version_numbers.split('.')[:4] if n.isdigit()
608-
) # type: ignore # use typeguard here
606+
self._version_info = cast(Tuple[int, int, int, int],
607+
tuple(int(n) for n in version_numbers.split('.')[:4] if n.isdigit())
608+
)
609609
else:
610610
super(Git, self)._set_cache_(attr)
611611
# END handle version info
612612

613-
@property
613+
@ property
614614
def working_dir(self) -> Union[None, PathLike]:
615615
""":return: Git directory we are working on"""
616616
return self._working_dir
617617

618-
@property
618+
@ property
619619
def version_info(self) -> Tuple[int, int, int, int]:
620620
"""
621621
:return: tuple(int, int, int, int) tuple with integers representing the major, minor
622622
and additional version numbers as parsed from git version.
623623
This value is generated on demand and is cached"""
624624
return self._version_info
625625

626-
@overload
626+
@ overload
627627
def execute(self,
628628
command: Union[str, Sequence[Any]],
629629
*,
630630
as_process: Literal[True]
631631
) -> 'AutoInterrupt':
632632
...
633633

634-
@overload
634+
@ overload
635635
def execute(self,
636636
command: Union[str, Sequence[Any]],
637637
*,
@@ -640,7 +640,7 @@ def execute(self,
640640
) -> Union[str, Tuple[int, str, str]]:
641641
...
642642

643-
@overload
643+
@ overload
644644
def execute(self,
645645
command: Union[str, Sequence[Any]],
646646
*,
@@ -649,7 +649,7 @@ def execute(self,
649649
) -> Union[bytes, Tuple[int, bytes, str]]:
650650
...
651651

652-
@overload
652+
@ overload
653653
def execute(self,
654654
command: Union[str, Sequence[Any]],
655655
*,
@@ -659,7 +659,7 @@ def execute(self,
659659
) -> str:
660660
...
661661

662-
@overload
662+
@ overload
663663
def execute(self,
664664
command: Union[str, Sequence[Any]],
665665
*,

0 commit comments

Comments
 (0)