Use to_native when validating proxy result (#32596)

* Use bytes directly instead of converting to text
(cherry picked from commit 708829fab9)
This commit is contained in:
David Hain 2017-11-06 12:20:07 -05:00 committed by Toshio Kuratomi
parent 793c473fe2
commit 97c3037206

View file

@ -675,7 +675,7 @@ class SSLValidationHandler(urllib_request.BaseHandler):
make sure we get back a valid code from the proxy
'''
try:
(http_version, resp_code, msg) = re.match(r'(HTTP/\d\.\d) (\d\d\d) (.*)', response).groups()
(http_version, resp_code, msg) = re.match(br'(HTTP/\d\.\d) (\d\d\d) (.*)', response).groups()
if int(resp_code) not in valid_codes:
raise Exception
except: