]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change _begin() back to begin().
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 12 Jul 2002 14:04:09 +0000 (14:04 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 12 Jul 2002 14:04:09 +0000 (14:04 +0000)
Client code could create responses explicitly.

Lib/httplib.py
Lib/test/test_httplib.py

index 1db930ea932e6756549ffc078c1186534a18caa0..34ed2da57f5c508e999b60ddf337f8a397f22402 100644 (file)
@@ -198,7 +198,6 @@ class HTTPMessage(mimetools.Message):
                 else:
                     self.status = self.status + '; bad seek'
                 break
-    
 
 class HTTPResponse:
 
@@ -260,7 +259,7 @@ class HTTPResponse:
             raise BadStatusLine(line)
         return version, status, reason
 
-    def _begin(self):
+    def begin(self):
         if self.msg is not None:
             # we've already started reading the response
             return
@@ -741,7 +740,7 @@ class HTTPConnection:
         else:
             response = self.response_class(self.sock, strict=self.strict)
 
-        response._begin()
+        response.begin()
         assert response.will_close != _UNKNOWN
         self.__state = _CS_IDLE
 
index 1edb062784d2e37a8dc0681cfed4907b3cf14578..09f92fc46a9f40e9f465a0377a1ad625a68902d2 100644 (file)
@@ -16,7 +16,7 @@ class FakeSocket:
 body = "HTTP/1.1 200 Ok\r\n\r\nText"
 sock = FakeSocket(body)
 resp = httplib.HTTPResponse(sock, 1)
-resp._begin()
+resp.begin()
 print resp.read()
 resp.close()
 
@@ -24,7 +24,7 @@ body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText"
 sock = FakeSocket(body)
 resp = httplib.HTTPResponse(sock, 1)
 try:
-    resp._begin()
+    resp.begin()
 except httplib.BadStatusLine:
     print "BadStatusLine raised as expected"
 else:
@@ -52,7 +52,7 @@ hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"'
        'Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"')
 s = FakeSocket(text)
 r = httplib.HTTPResponse(s, 1)
-r._begin()
+r.begin()
 cookies = r.getheader("Set-Cookie")
 if cookies != hdr:
     raise AssertionError, "multiple headers not combined properly"