Apply same fix to success path.

This commit is contained in:
Itamar Turner-Trauring 2021-06-15 14:05:49 -04:00
parent e8308043e3
commit f778d25c44

View File

@ -94,7 +94,10 @@ def do_http(method, url, body=b""):
def format_http_success(resp):
return "%s %s" % (resp.status, quote_output(resp.reason, quotemarks=False))
# ensure_text() shouldn't be necessary when Python 2 is dropped.
return quote_output(
"%s %s" % (resp.status, six.ensure_text(resp.reason)),
quotemarks=False)
def format_http_error(msg, resp):
# ensure_text() shouldn't be necessary when Python 2 is dropped.