diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-31 22:59:11 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-31 22:59:11 +0100 |
commit | c878771e3a31c983a0c3468396ed33a532f87e98 (patch) | |
tree | ed7d6b93e0f72e25e52009d99a42cdfc6bcbb632 /git/cmd.py | |
parent | 39d37d550963a6a64e66ba3d6b9f4b077270a3ad (diff) | |
download | gitpython-c878771e3a31c983a0c3468396ed33a532f87e98.tar.gz |
replace more TBDs wiht runtime types
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -421,15 +421,15 @@ class Git(LazyMixin): return getattr(self.proc, attr) # TODO: Bad choice to mimic `proc.wait()` but with different args. - def wait(self, stderr: Union[None, bytes] = b'') -> int: + def wait(self, stderr: Union[None, str, bytes] = b'') -> int: """Wait for the process and return its status code. :param stderr: Previously read value of stderr, in case stderr is already closed. :warn: may deadlock if output or error pipes are used and not handled separately. :raise GitCommandError: if the return status is not 0""" if stderr is None: - stderr = b'' - stderr = force_bytes(data=stderr, encoding='utf-8') + stderr_b = b'' + stderr_b = force_bytes(data=stderr, encoding='utf-8') if self.proc is not None: status = self.proc.wait() @@ -437,11 +437,11 @@ class Git(LazyMixin): def read_all_from_possibly_closed_stream(stream: Union[IO[bytes], None]) -> bytes: if stream: try: - return stderr + force_bytes(stream.read()) + return stderr_b + force_bytes(stream.read()) except ValueError: - return stderr or b'' + return stderr_b or b'' else: - return stderr or b'' + return stderr_b or b'' if status != 0: errstr = read_all_from_possibly_closed_stream(self.proc.stderr) |