summaryrefslogtreecommitdiff
path: root/git/exc.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-06 16:11:34 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-06 16:11:34 +0100
commit56e942318f3c493c8dcd4759f806034331ebeda5 (patch)
tree82cdca65cd197f36ea3680171186e0ddcf234266 /git/exc.py
parentd46e3fe9cb0dea2617cd9231d29bf6919b0f1e91 (diff)
parent68f8a43d1b643318732f30ee1cd75e1d315a4537 (diff)
downloadgitpython-56e942318f3c493c8dcd4759f806034331ebeda5.tar.gz
Merge branch 'py3' into 0.3
Conflicts: git/refs/log.py
Diffstat (limited to 'git/exc.py')
-rw-r--r--git/exc.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/git/exc.py b/git/exc.py
index ba57c624..42191c62 100644
--- a/git/exc.py
+++ b/git/exc.py
@@ -7,6 +7,8 @@
from gitdb.exc import * # NOQA
+from git.compat import defenc
+
class InvalidGitRepositoryError(Exception):
@@ -29,10 +31,12 @@ class GitCommandError(Exception):
self.command = command
def __str__(self):
- ret = "'%s' returned exit status %i: %s" % \
- (' '.join(str(i) for i in self.command), self.status, self.stderr)
- if self.stdout is not None:
- ret += "\nstdout: %s" % self.stdout
+ ret = "'%s' returned with exit code %i" % \
+ (' '.join(str(i) for i in self.command), self.status)
+ if self.stderr:
+ ret += "\nstderr: '%s'" % self.stderr.decode(defenc)
+ if self.stdout:
+ ret += "\nstdout: '%s'" % self.stdout.decode(defenc)
return ret