travis: fix style

This commit is contained in:
Oleksii Shevchuk 2019-05-25 07:59:45 +03:00
parent a35bd8f2ec
commit 211892aebf
4 changed files with 34 additions and 24 deletions

View File

@ -98,7 +98,6 @@ class http(PupyModule):
self.log(result)
except Exception, e:
raise
if hasattr(e, 'reason'):
message = '{} {} ({})'.format(e.code, e.reason, e.filename)
if e.code / 100 < 4:

View File

@ -3,6 +3,8 @@
from pupylib.PupyModule import config, PupyModule, PupyArgumentParser
from pupylib.PupyOutput import Table
@config(cat='creds')
class NetCreds(PupyModule):
''' Manage saved authentication information '''

View File

@ -112,32 +112,41 @@ class ProxyError(IOError):
def __str__(self):
return self.msg
class GeneralProxyError(ProxyError):
pass
class ProxyConnectionError(ProxyError):
pass
class SOCKS5AuthError(ProxyError):
pass
class SOCKS5Error(ProxyError):
pass
class SOCKS4Error(ProxyError):
pass
class HTTPError(ProxyError):
pass
class AuthenticationRequired(ProxyError):
__slots__ = ('methods',)
def __init__(self, methods):
super(AuthenticationRequired, self).__init__(
'Authentication required, supported methods: {}'.format(
';'.join(methods)))
self.methods = methods
class AuthenticationImpossible(EOFError):
pass
@ -1131,7 +1140,7 @@ class socksocket(_BaseSocket):
try:
self._connect(self, dest_pair)
break
except AuthenticationRequired as e:
except AuthenticationRequired:
_orig_socket.__init__(
self, *self._orig_args, **self._orig_kwargs)

View File

@ -150,7 +150,7 @@ class HTTPContext(urllib2.BaseHandler):
if host not in self.headers:
self.headers[host] = {}
self.headers[host][header] = request.get_headers(header)
self.headers[host][header] = headers.get(header)
https_request = http_request
https_response = http_response