[Python-checkins] python/dist/src/Lib httplib.py,1.52,1.53

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Fri, 28 Jun 2002 16:38:16 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv14075

Modified Files:
	httplib.py 
Log Message:
Simplify HTTPSConnection constructor.

See discussion in SF bug 458463.


Index: httplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** httplib.py	28 Jun 2002 22:38:01 -0000	1.52
--- httplib.py	28 Jun 2002 23:38:14 -0000	1.53
***************
*** 79,86 ****
  __all__ = ["HTTP", "HTTPResponse", "HTTPConnection", "HTTPSConnection",
             "HTTPException", "NotConnected", "UnknownProtocol",
!            "UnknownTransferEncoding", "IllegalKeywordArgument",
!            "UnimplementedFileMode", "IncompleteRead", "InvalidURL",
!            "ImproperConnectionState", "CannotSendRequest", "CannotSendHeader",
!            "ResponseNotReady", "BadStatusLine", "error"]
  
  HTTP_PORT = 80
--- 79,86 ----
  __all__ = ["HTTP", "HTTPResponse", "HTTPConnection", "HTTPSConnection",
             "HTTPException", "NotConnected", "UnknownProtocol",
!            "UnknownTransferEncoding", "UnimplementedFileMode",
!            "IncompleteRead", "InvalidURL", "ImproperConnectionState",
!            "CannotSendRequest", "CannotSendHeader", "ResponseNotReady",
!            "BadStatusLine", "error"]
  
  HTTP_PORT = 80
***************
*** 734,752 ****
      default_port = HTTPS_PORT
  
!     def __init__(self, host, port=None, **x509):
!         keys = x509.keys()
!         try:
!             keys.remove('key_file')
!         except ValueError:
!             pass
!         try:
!             keys.remove('cert_file')
!         except ValueError:
!             pass
!         if keys:
!             raise IllegalKeywordArgument()
          HTTPConnection.__init__(self, host, port)
!         self.key_file = x509.get('key_file')
!         self.cert_file = x509.get('cert_file')
  
      def connect(self):
--- 734,741 ----
      default_port = HTTPS_PORT
  
!     def __init__(self, host, port=None, key_file=None, cert_file=None):
          HTTPConnection.__init__(self, host, port)
!         self.key_file = key_file
!         self.cert_file = cert_file
  
      def connect(self):
***************
*** 890,896 ****
  
  class UnknownTransferEncoding(HTTPException):
-     pass
- 
- class IllegalKeywordArgument(HTTPException):
      pass
  
--- 879,882 ----