sync: fix print error when handling server error

When converting this logic from print() to the output buffer, this
error codepath should have dropped the use of the file= redirect.

Bug: https://crbug.com/gerrit/14482
Change-Id: Ib484924a2031ba3295c1c1a5b9a2d816b9912279
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305142
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger 2021-05-04 07:21:19 -04:00
parent cd89ec147a
commit 0ae9503a86

View File

@ -2205,7 +2205,7 @@ class Project(object):
# Figure out how long to sleep before the next attempt, if there is one.
if not verbose:
output_redir.write('\n%s:\n%s' % (self.name, gitcmd.stdout), file=sys.stderr)
output_redir.write('\n%s:\n%s' % (self.name, gitcmd.stdout))
if try_n < retry_fetches - 1:
output_redir.write('sleeping %s seconds before retrying' % retry_cur_sleep)
time.sleep(retry_cur_sleep)