diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-19 19:10:45 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-19 19:10:45 +0100 |
commit | 9e5e969479ec6018e1ba06b95bcdefca5b0082a4 (patch) | |
tree | 574e03c6c4acd1067e3b285974651ec9e9529a49 /git/cmd.py | |
parent | 9a587e14d509cc77bf47b9591d1def3e5a1df570 (diff) | |
download | gitpython-9e5e969479ec6018e1ba06b95bcdefca5b0082a4.tar.gz |
Change remaining type comments to py3.6+ types
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -565,11 +565,11 @@ class Git(LazyMixin): .git directory in case of bare repositories.""" super(Git, self).__init__() self._working_dir = expand_path(working_dir) - self._git_options = () # type: Union[List[str], Tuple[str, ...]] - self._persistent_git_options = [] # type: List[str] + self._git_options: Union[List[str], Tuple[str, ...]] = () + self._persistent_git_options: List[str] = [] # Extra environment variables to pass to git commands - self._environment = {} # type: Dict[str, str] + self._environment: Dict[str, str] = {} # cached command slots self.cat_file_header = None @@ -603,9 +603,9 @@ 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( + self._version_info: Tuple[int, int, int, int] = tuple( int(n) for n in version_numbers.split('.')[:4] if n.isdigit() - ) # type: Tuple[int, int, int, int] # type: ignore + ) # type: ignore # use typeguard here else: super(Git, self)._set_cache_(attr) # END handle version info @@ -868,8 +868,8 @@ class Git(LazyMixin): # Wait for the process to return status = 0 - stdout_value = b'' # type: Union[str, bytes] - stderr_value = b'' # type: Union[str, bytes] + stdout_value: Union[str, bytes] = b'' + stderr_value: Union[str, bytes] = b'' newline = "\n" if universal_newlines else b"\n" try: if output_stream is None: @@ -1145,7 +1145,7 @@ class Git(LazyMixin): # required for command to separate refs on stdin, as bytes if isinstance(ref, bytes): # Assume 40 bytes hexsha - bin-to-ascii for some reason returns bytes, not text - refstr = ref.decode('ascii') # type: str + refstr: str = ref.decode('ascii') elif not isinstance(ref, str): refstr = str(ref) # could be ref-object else: |