summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-08-08 21:42:34 +0100
committerYobmod <yobmod@gmail.com>2021-08-08 21:42:34 +0100
commit38f5157253beb5801be80812e9b013a3cdd0bdc9 (patch)
treee75c305577966395857d15ff081beb9afe037828 /git/cmd.py
parent9d844a624b1cf207f0c379dc64f9b4767d89877d (diff)
downloadgitpython-38f5157253beb5801be80812e9b013a3cdd0bdc9.tar.gz
add type check to conf_encoding (in thoery could be bool or int)
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py8
1 files changed, 3 insertions, 5 deletions
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', '')