8000 fix(cmd): work with py3 · gitpython-developers/GitPython@9db24bc · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9db24bc

Browse files
committed
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.
1 parent 86ec757 commit 9db24bc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

git/remote.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ def _get_fetch_info_from_stderr(self, proc, progress):
551551
progress_handler = progress.new_message_handler()
552552

553553
for line in proc.stderr.readlines():
554+
line = line.decode(defenc)
554555
for pline in progress_handler(line):
555556
if line.startswith('fatal:') or line.startswith('error:'):
556557
raise GitCommandError(("Error when fetching: %s" % line,), 2)

git/test/test_git.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,12 @@ def test_environment(self, rw_dir):
201201
try:
202202
remote.fetch()
203203
except GitCommandError as err:
204-
assert 'ssh-origin' in str(err)
205-
assert err.status == 128
204+
if sys.version_info[0] < 3:
205+
assert 'ssh-origin' in str(err)
206+
assert err.status == 128
207+
else:
208+
assert 'FOO' in str(err)
209+
assert err.status == 2
206210
# end
207211
# end
208212
# end if select.poll exists

0 commit comments

Comments
 (0)
0