Skip to content

Commit 7683c26

Browse files
committed
amended Client class to pass **kwargs on to super
Allows more flexibility when instantiating a Client in passing arguments to the super httplib2.Http init. Using in my case because the remote server (flickr) has incorrectly configured SSL certificates, but could be general-purpose useful.
1 parent a83f4a2 commit 7683c26

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

oauth2/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,7 @@ def _split_url_string(param_str):
615615
class Client(httplib2.Http):
616616
"""OAuthClient is a worker to attempt to execute a request."""
617617

618-
def __init__(self, consumer, token=None, cache=None, timeout=None,
619-
proxy_info=None):
618+
def __init__(self, consumer, token=None, **kwargs):
620619

621620
if consumer is not None and not isinstance(consumer, Consumer):
622621
raise ValueError("Invalid consumer.")
@@ -628,7 +627,7 @@ def __init__(self, consumer, token=None, cache=None, timeout=None,
628627
self.token = token
629628
self.method = SignatureMethod_HMAC_SHA1()
630629

631-
httplib2.Http.__init__(self, cache=cache, timeout=timeout, proxy_info=proxy_info)
630+
super(Client, self).__init__(**kwargs)
632631

633632
def set_signature_method(self, method):
634633
if not isinstance(method, SignatureMethod):

0 commit comments

Comments
 (0)