Skip to content

Commit

Permalink
Make SocksiPy legacy functions kwarg-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mleinart committed Mar 8, 2017
1 parent b3d53f3 commit 682ac28
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions socks.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def set_default_proxy(proxy_type=None, addr=None, port=None, rdns=True, username
username.encode() if username else None,
password.encode() if password else None)

setdefaultproxy = set_default_proxy
def setdefaultproxy(*args, **kwargs):
if 'proxytype' in kwargs:
kwargs['proxy_type'] = kwargs.pop('proxytype')
return set_default_proxy(*args, **kwargs)

def get_default_proxy():
"""
Expand Down Expand Up @@ -321,7 +324,10 @@ def set_proxy(self, proxy_type=None, addr=None, port=None, rdns=True, username=N
username.encode() if username else None,
password.encode() if password else None)

setproxy = set_proxy
def setproxy(self, *args, **kwargs):
if 'proxytype' in kwargs:
kwargs['proxy_type'] = kwargs.pop('proxytype')
return self.set_proxy(*args, **kwargs)

def bind(self, *pos, **kw):
"""
Expand Down

0 comments on commit 682ac28

Please sign in to comment.