summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-07-03 16:43:51 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-07-03 16:43:51 +0200
commit9db24bc7a617cf93321bb60de6af2a20efd6afc1 (patch)
tree30cd36340d09929ba09cb3bead45bbcdcc412327
parent86ec7573a87cd8136d7d497b99594f29e17406d3 (diff)
downloadgitpython-9db24bc7a617cf93321bb60de6af2a20efd6afc1.tar.gz
fix(cmd): work with py3
Fixed additional test which seems to have different outcomes depending on the interpreter. This just makes it work withouth attempting to find the root cause of the issue.
-rw-r--r--git/remote.py1
-rw-r--r--git/test/test_git.py8
2 files changed, 7 insertions, 2 deletions
diff --git a/git/remote.py b/git/remote.py
index 7cb0f4f8..00d95b3c 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -551,6 +551,7 @@ class Remote(LazyMixin, Iterable):
progress_handler = progress.new_message_handler()
for line in proc.stderr.readlines():
+ line = line.decode(defenc)
for pline in progress_handler(line):
if line.startswith('fatal:') or line.startswith('error:'):
raise GitCommandError(("Error when fetching: %s" % line,), 2)
diff --git a/git/test/test_git.py b/git/test/test_git.py
index fe7ec970..fca00d40 100644
--- a/git/test/test_git.py
+++ b/git/test/test_git.py
@@ -201,8 +201,12 @@ class TestGit(TestBase):
try:
remote.fetch()
except GitCommandError as err:
- assert 'ssh-origin' in str(err)
- assert err.status == 128
+ if sys.version_info[0] < 3:
+ assert 'ssh-origin' in str(err)
+ assert err.status == 128
+ else:
+ assert 'FOO' in str(err)
+ assert err.status == 2
# end
# end
# end if select.poll exists