mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Whitespace normalization.
This commit is contained in:
parent
8de0c1716b
commit
85ba673b0a
6 changed files with 11 additions and 12 deletions
|
@ -561,17 +561,17 @@ class FancyURLopener(URLopener):
|
|||
See this URL for a description of the basic authentication scheme:
|
||||
http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt"""
|
||||
if not headers.has_key('www-authenticate'):
|
||||
URLopener.http_error_default(self, url, fp,
|
||||
URLopener.http_error_default(self, url, fp,
|
||||
errmsg, headers)
|
||||
stuff = headers['www-authenticate']
|
||||
import re
|
||||
match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
|
||||
if not match:
|
||||
URLopener.http_error_default(self, url, fp,
|
||||
URLopener.http_error_default(self, url, fp,
|
||||
errcode, errmsg, headers)
|
||||
scheme, realm = match.groups()
|
||||
if scheme.lower() != 'basic':
|
||||
URLopener.http_error_default(self, url, fp,
|
||||
URLopener.http_error_default(self, url, fp,
|
||||
errcode, errmsg, headers)
|
||||
name = 'retry_' + self.type + '_basic_auth'
|
||||
if data is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue