summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-06-28 23:38:14 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-06-28 23:38:14 (GMT)
commit7c75c99a10691998b7e1506ede4f98eec28bd226 (patch)
treefe784980c1d7067eb5d917c4ca65f95c83c8ae95
parent13f99d7097c23231c18049904b651956e0fd771c (diff)
downloadcpython-7c75c99a10691998b7e1506ede4f98eec28bd226.zip
cpython-7c75c99a10691998b7e1506ede4f98eec28bd226.tar.gz
cpython-7c75c99a10691998b7e1506ede4f98eec28bd226.tar.bz2
Simplify HTTPSConnection constructor.
See discussion in SF bug 458463.
-rw-r--r--Lib/httplib.py28
1 files changed, 7 insertions, 21 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index c1c4fe1..5a039e7 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -78,10 +78,10 @@ except ImportError:
__all__ = ["HTTP", "HTTPResponse", "HTTPConnection", "HTTPSConnection",
"HTTPException", "NotConnected", "UnknownProtocol",
- "UnknownTransferEncoding", "IllegalKeywordArgument",
- "UnimplementedFileMode", "IncompleteRead", "InvalidURL",
- "ImproperConnectionState", "CannotSendRequest", "CannotSendHeader",
- "ResponseNotReady", "BadStatusLine", "error"]
+ "UnknownTransferEncoding", "UnimplementedFileMode",
+ "IncompleteRead", "InvalidURL", "ImproperConnectionState",
+ "CannotSendRequest", "CannotSendHeader", "ResponseNotReady",
+ "BadStatusLine", "error"]
HTTP_PORT = 80
HTTPS_PORT = 443
@@ -733,21 +733,10 @@ class HTTPSConnection(HTTPConnection):
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()
+ def __init__(self, host, port=None, key_file=None, cert_file=None):
HTTPConnection.__init__(self, host, port)
- self.key_file = x509.get('key_file')
- self.cert_file = x509.get('cert_file')
+ self.key_file = key_file
+ self.cert_file = cert_file
def connect(self):
"Connect to a host on a given (SSL) port."
@@ -891,9 +880,6 @@ class UnknownProtocol(HTTPException):
class UnknownTransferEncoding(HTTPException):
pass
-class IllegalKeywordArgument(HTTPException):
- pass
-
class UnimplementedFileMode(HTTPException):
pass