diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-11-30 04:34:30 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-11-30 04:34:30 (GMT) |
commit | e39bba2ab18db15e629f1738f0daf269de086724 (patch) | |
tree | 7dc4c0651fb3cb6398d841c809fcd738b4f81a56 /Lib | |
parent | 3a9c68e608aca856da55eb5765173d3bf0a55ed2 (diff) | |
parent | c1da3d1ed86284cc49cd7880a57a404de8965b24 (diff) | |
download | cpython-e39bba2ab18db15e629f1738f0daf269de086724.zip cpython-e39bba2ab18db15e629f1738f0daf269de086724.tar.gz cpython-e39bba2ab18db15e629f1738f0daf269de086724.tar.bz2 |
merge 3.4 (#22960)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/xmlrpc/client.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index 3a1435d..dbd9143 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1324,6 +1324,11 @@ class Transport: class SafeTransport(Transport): """Handles an HTTPS transaction to an XML-RPC server.""" + def __init__(self, use_datetime=False, use_builtin_types=False, *, + context=None): + super().__init__(use_datetime=use_datetime, use_builtin_types=use_builtin_types) + self.context = context + # FIXME: mostly untested def make_connection(self, host): @@ -1337,7 +1342,7 @@ class SafeTransport(Transport): # host may be a string, or a (host, x509-dict) tuple chost, self._extra_headers, x509 = self.get_host_info(host) self._connection = host, http.client.HTTPSConnection(chost, - None, **(x509 or {})) + None, context=self.context, **(x509 or {})) return self._connection[1] ## @@ -1380,7 +1385,8 @@ class ServerProxy: """ def __init__(self, uri, transport=None, encoding=None, verbose=False, - allow_none=False, use_datetime=False, use_builtin_types=False): + allow_none=False, use_datetime=False, use_builtin_types=False, + *, context=None): # establish a "logical" server connection # get the url @@ -1394,10 +1400,13 @@ class ServerProxy: if transport is None: if type == "https": handler = SafeTransport + extra_kwargs = {"context": context} else: handler = Transport + extra_kwargs = {} transport = handler(use_datetime=use_datetime, - use_builtin_types=use_builtin_types) + use_builtin_types=use_builtin_types, + **extra_kwargs) self.__transport = transport self.__encoding = encoding or 'utf-8' |