Skip to content

Commit 4720e63

Browse files
cool-RRByron
authored andcommitted
Fix exception causes in cmd.py
1 parent 24cd6da commit 4720e63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎git/cmd.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def pump_stream(cmdline, name, stream, is_decode, handler):
8383
handler(line)
8484
exceptExceptionasex:
8585
log.error("Pumping %r of cmd(%s) failed due to: %r", name, cmdline, ex)
86-
raiseCommandError(['<%s-pump>'%name] +cmdline, ex)
86+
raiseCommandError(['<%s-pump>'%name] +cmdline, ex)fromex
8787
finally:
8888
stream.close()
8989

@@ -732,7 +732,7 @@ def execute(self, command,
732732
**subprocess_kwargs
733733
)
734734
exceptcmd_not_found_exceptionaserr:
735-
raiseGitCommandNotFound(command, err)
735+
raiseGitCommandNotFound(command, err)fromerr
736736

737737
ifas_process:
738738
returnself.AutoInterrupt(proc, command)
@@ -982,9 +982,9 @@ def _call_process(self, method, *args, **kwargs):
982982
else:
983983
try:
984984
index=ext_args.index(insert_after_this_arg)
985-
exceptValueError:
985+
exceptValueErroraserr:
986986
raiseValueError("Couldn't find argument '%s' in args %s to insert cmd options after"
987-
% (insert_after_this_arg, str(ext_args)))
987+
% (insert_after_this_arg, str(ext_args)))fromerr
988988
# end handle error
989989
args=ext_args[:index+1] +opt_args+ext_args[index+1:]
990990
# end handle opts_kwargs

0 commit comments

Comments
(0)