summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--git_config.py3
-rwxr-xr-xrepo2
2 files changed, 3 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py
index ca1282a3..cdfeddd0 100644
--- a/git_config.py
+++ b/git_config.py
@@ -657,13 +657,14 @@ class Remote(object):
657 info = urllib.request.urlopen(info_url, context=context).read() 657 info = urllib.request.urlopen(info_url, context=context).read()
658 else: 658 else:
659 info = urllib.request.urlopen(info_url).read() 659 info = urllib.request.urlopen(info_url).read()
660 if info == 'NOT_AVAILABLE' or '<' in info: 660 if info == b'NOT_AVAILABLE' or b'<' in info:
661 # If `info` contains '<', we assume the server gave us some sort 661 # If `info` contains '<', we assume the server gave us some sort
662 # of HTML response back, like maybe a login page. 662 # of HTML response back, like maybe a login page.
663 # 663 #
664 # Assume HTTP if SSH is not enabled or ssh_info doesn't look right. 664 # Assume HTTP if SSH is not enabled or ssh_info doesn't look right.
665 self._review_url = http_url 665 self._review_url = http_url
666 else: 666 else:
667 info = info.decode('utf-8')
667 host, port = info.split() 668 host, port = info.split()
668 self._review_url = self._SshReviewUrl(userEmail, host, port) 669 self._review_url = self._SshReviewUrl(userEmail, host, port)
669 except urllib.error.HTTPError as e: 670 except urllib.error.HTTPError as e:
diff --git a/repo b/repo
index aa357a22..ce42ad06 100755
--- a/repo
+++ b/repo
@@ -583,7 +583,7 @@ def _DownloadBundle(url, local, quiet):
583 print('Get %s' % url, file=sys.stderr) 583 print('Get %s' % url, file=sys.stderr)
584 while True: 584 while True:
585 buf = r.read(8192) 585 buf = r.read(8192)
586 if buf == '': 586 if not buf:
587 return True 587 return True
588 dest.write(buf) 588 dest.write(buf)
589 finally: 589 finally: