From 38f5157253beb5801be80812e9b013a3cdd0bdc9 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Sun, 8 Aug 2021 21:42:34 +0100 Subject: add type check to conf_encoding (in thoery could be bool or int) --- git/cmd.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 353cbf03..ff1dfa34 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -109,18 +109,16 @@ def handle_process_output(process: 'Git.AutoInterrupt' | Popen, else: handler(line) except Exception as ex: - log.error(f"Pumping {name!r} of cmd({remove_password_if_present(cmdline)})} failed due to: {ex!r}") + log.error(f"Pumping {name!r} of cmd({remove_password_if_present(cmdline)}) failed due to: {ex!r}") raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex finally: stream.close() - - if hasattr(process, 'proc'): process = cast('Git.AutoInterrupt', process) cmdline: str | Tuple[str, ...] | List[str] = getattr(process.proc, 'args', '') - p_stdout = process.proc.stdout - p_stderr = process.proc.stderr + p_stdout = process.proc.stdout if process.proc else None + p_stderr = process.proc.stderr if process.proc else None else: process = cast(Popen, process) cmdline = getattr(process, 'args', '') -- cgit v1.2.1