@@ -267,8 +267,6 @@ def parse_headers(fp, _class=HTTPMessage):
267267 return email .parser .Parser (_class = _class ).parsestr (hstring )
268268
269269
270- _strict_sentinel = object ()
271-
272270class HTTPResponse (io .RawIOBase ):
273271
274272 # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
@@ -278,7 +276,7 @@ class HTTPResponse(io.RawIOBase):
278276 # text following RFC 2047. The basic status line parsing only
279277 # accepts iso-8859-1.
280278
281- def __init__ (self , sock , debuglevel = 0 , strict = _strict_sentinel , method = None , url = None ):
279+ def __init__ (self , sock , debuglevel = 0 , method = None , url = None ):
282280 # If the response includes a content-length header, we need to
283281 # make sure that the client doesn't read more than the
284282 # specified number of bytes. If it does, it will block until
@@ -288,10 +286,6 @@ def __init__(self, sock, debuglevel=0, strict=_strict_sentinel, method=None, url
288286 # clients unless they know what they are doing.
289287 self .fp = sock .makefile ("rb" )
290288 self .debuglevel = debuglevel
291- if strict is not _strict_sentinel :
292- warnings .warn ("the 'strict' argument isn't supported anymore; "
293- "http.client now always assumes HTTP/1.x compliant servers." ,
294- DeprecationWarning , 2 )
295289 self ._method = method
296290
297291 # The HTTPResponse object is returned via urllib. The clients
@@ -737,12 +731,8 @@ class HTTPConnection:
737731 # as a reasonable estimate of the maximum MSS.
738732 mss = 16384
739733
740- def __init__ (self , host , port = None , strict = _strict_sentinel ,
741- timeout = socket ._GLOBAL_DEFAULT_TIMEOUT , source_address = None ):
742- if strict is not _strict_sentinel :
743- warnings .warn ("the 'strict' argument isn't supported anymore; "
744- "http.client now always assumes HTTP/1.x compliant servers." ,
745- DeprecationWarning , 2 )
734+ def __init__ (self , host , port = None , timeout = socket ._GLOBAL_DEFAULT_TIMEOUT ,
735+ source_address = None ):
746736 self .timeout = timeout
747737 self .source_address = source_address
748738 self .sock = None
@@ -1177,9 +1167,10 @@ class HTTPSConnection(HTTPConnection):
11771167 # XXX Should key_file and cert_file be deprecated in favour of context?
11781168
11791169 def __init__ (self , host , port = None , key_file = None , cert_file = None ,
1180- strict = _strict_sentinel , timeout = socket ._GLOBAL_DEFAULT_TIMEOUT ,
1181- source_address = None , * , context = None , check_hostname = None ):
1182- super (HTTPSConnection , self ).__init__ (host , port , strict , timeout ,
1170+ timeout = socket ._GLOBAL_DEFAULT_TIMEOUT ,
1171+ source_address = None , * , context = None ,
1172+ check_hostname = None ):
1173+ super (HTTPSConnection , self ).__init__ (host , port , timeout ,
11831174 source_address )
11841175 self .key_file = key_file
11851176 self .cert_file = cert_file
0 commit comments