summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorRam Rachum <ram@rachum.com>2020-06-12 12:57:54 +0300
committerSebastian Thiel <sebastian.thiel@icloud.com>2020-06-12 22:51:35 +0800
commit4720e6337bb14f24ec0b2b4a96359a9460dadee4 (patch)
tree502150b3ec80a73b79b72807fe2de4ecd57d945b /git
parent24cd6dafc0008f155271f9462ae6ba6f0c0127a4 (diff)
downloadgitpython-4720e6337bb14f24ec0b2b4a96359a9460dadee4.tar.gz
Fix exception causes in cmd.py
Diffstat (limited to 'git')
-rw-r--r--git/cmd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/git/cmd.py b/git/cmd.py
index e87a3b80..acea40c5 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -83,7 +83,7 @@ def handle_process_output(process, stdout_handler, stderr_handler,
handler(line)
except Exception as ex:
log.error("Pumping %r of cmd(%s) failed due to: %r", name, cmdline, ex)
- raise CommandError(['<%s-pump>' % name] + cmdline, ex)
+ raise CommandError(['<%s-pump>' % name] + cmdline, ex) from ex
finally:
stream.close()
@@ -732,7 +732,7 @@ class Git(LazyMixin):
**subprocess_kwargs
)
except cmd_not_found_exception as err:
- raise GitCommandNotFound(command, err)
+ raise GitCommandNotFound(command, err) from err
if as_process:
return self.AutoInterrupt(proc, command)
@@ -982,9 +982,9 @@ class Git(LazyMixin):
else:
try:
index = ext_args.index(insert_after_this_arg)
- except ValueError:
+ except ValueError as err:
raise ValueError("Couldn't find argument '%s' in args %s to insert cmd options after"
- % (insert_after_this_arg, str(ext_args)))
+ % (insert_after_this_arg, str(ext_args))) from err
# end handle error
args = ext_args[:index + 1] + opt_args + ext_args[index + 1:]
# end handle opts_kwargs