Skip to content

Commit

Permalink
Bump black up to 18.6b4
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Aug 22, 2018
1 parent 60a8931 commit 57201d2
Show file tree
Hide file tree
Showing 38 changed files with 60 additions and 169 deletions.
1 change: 0 additions & 1 deletion demos/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class ForwardServer(SocketServer.ThreadingTCPServer):


class Handler(SocketServer.BaseRequestHandler):

def handle(self):
try:
chan = self.ssh_transport.open_channel(
Expand Down
2 changes: 2 additions & 0 deletions paramiko/_winapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class SECURITY_DESCRIPTOR(ctypes.Structure):
PACL Dacl;
} SECURITY_DESCRIPTOR;
"""

SECURITY_DESCRIPTOR_CONTROL = ctypes.wintypes.USHORT
REVISION = 1

Expand All @@ -316,6 +317,7 @@ class SECURITY_ATTRIBUTES(ctypes.Structure):
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES;
"""

_fields_ = [
("nLength", ctypes.wintypes.DWORD),
("lpSecurityDescriptor", ctypes.c_void_p),
Expand Down
1 change: 0 additions & 1 deletion paramiko/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@


class AgentSSH(object):

def __init__(self):
self._conn = None
self._keys = ()
Expand Down
1 change: 1 addition & 0 deletions paramiko/buffered_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PipeTimeout(IOError):
"""
Indicates that a timeout was reached on a read from a `.BufferedPipe`.
"""

pass


Expand Down
1 change: 0 additions & 1 deletion paramiko/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,6 @@ def _write(self, data):


class ChannelStderrFile(ChannelFile):

def __init__(self, channel, mode="r", bufsize=-1):
ChannelFile.__init__(self, channel, mode, bufsize)

Expand Down
2 changes: 0 additions & 2 deletions paramiko/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


class ZlibCompressor(object):

def __init__(self):
# Use the default level of zlib compression
self.z = zlib.compressobj()
Expand All @@ -34,7 +33,6 @@ def __call__(self, data):


class ZlibDecompressor(object):

def __init__(self):
self.z = zlib.decompressobj()

Expand Down
2 changes: 0 additions & 2 deletions paramiko/hostkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def lookup(self, hostname):
"""

class SubDict(MutableMapping):

def __init__(self, hostname, entries, hostkeys):
self._hostname = hostname
self._entries = entries
Expand Down Expand Up @@ -308,7 +307,6 @@ def hash_host(hostname, salt=None):


class InvalidHostKey(Exception):

def __init__(self, line, exc):
self.line = line
self.exc = exc
Expand Down
4 changes: 1 addition & 3 deletions paramiko/kex_group1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
class KexGroup1(object):

# draft-ietf-secsh-transport-09.txt, page 17
P = (
0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF # noqa
)
P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF # noqa
G = 2

name = "diffie-hellman-group1-sha1"
Expand Down
4 changes: 1 addition & 3 deletions paramiko/kex_group14.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
class KexGroup14(KexGroup1):

# http://tools.ietf.org/html/rfc3526#section-3
P = (
0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF # noqa
)
P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF # noqa
G = 2

name = "diffie-hellman-group14-sha1"
Expand Down
11 changes: 5 additions & 6 deletions paramiko/kex_gss.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ class KexGSSGroup1(object):
GSS-API / SSPI Authenticated Diffie-Hellman Key Exchange as defined in `RFC
4462 Section 2 <https://tools.ietf.org/html/rfc4462.html#section-2>`_
"""

# draft-ietf-secsh-transport-09.txt, page 17
P = (
0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF # noqa
)
P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF # noqa
G = 2
b7fffffffffffffff = byte_chr(0x7f) + max_byte * 7 # noqa
b0000000000000000 = zero_byte * 8 # noqa
Expand Down Expand Up @@ -322,9 +321,8 @@ class KexGSSGroup14(KexGSSGroup1):
in `RFC 4462 Section 2
<https://tools.ietf.org/html/rfc4462.html#section-2>`_
"""
P = (
0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF # noqa
)

P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF # noqa
G = 2
NAME = "gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g=="

Expand All @@ -334,6 +332,7 @@ class KexGSSGex(object):
GSS-API / SSPI Authenticated Diffie-Hellman Group Exchange as defined in
`RFC 4462 Section 2 <https://tools.ietf.org/html/rfc4462.html#section-2>`_
"""

NAME = "gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g=="
min_bits = 1024
max_bits = 8192
Expand Down
1 change: 1 addition & 0 deletions paramiko/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class NeedRekeyException(Exception):
"""
Exception indicating a rekey is needed.
"""

pass


Expand Down
2 changes: 0 additions & 2 deletions paramiko/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def make_pipe():


class PosixPipe(object):

def __init__(self):
self._rfd, self._wfd = os.pipe()
self._set = False
Expand Down Expand Up @@ -120,7 +119,6 @@ def set_forever(self):


class OrPipe(object):

def __init__(self, pipe):
self._set = False
self._partner = None
Expand Down
1 change: 0 additions & 1 deletion paramiko/py3compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def next(c):

# It's possible to have sizeof(long) != sizeof(Py_ssize_t).
class X(object):

def __len__(self):
return 1 << 31

Expand Down
1 change: 0 additions & 1 deletion paramiko/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class SFTPError(Exception):


class BaseSFTP(object):

def __init__(self):
self.logger = util.get_logger("paramiko.sftp")
self.sock = None
Expand Down
1 change: 1 addition & 0 deletions paramiko/sftp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,4 +917,5 @@ class SFTP(SFTPClient):
"""
An alias for `.SFTPClient` for backwards compatibility.
"""

pass
5 changes: 5 additions & 0 deletions paramiko/ssh_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class SSHException(Exception):
"""
Exception raised by failures in SSH2 protocol negotiation or logic errors.
"""

pass


Expand All @@ -34,13 +35,15 @@ class AuthenticationException(SSHException):
.. versionadded:: 1.6
"""

pass


class PasswordRequiredException(AuthenticationException):
"""
Exception raised when a password is needed to unlock a private key file.
"""

pass


Expand All @@ -52,6 +55,7 @@ class BadAuthenticationType(AuthenticationException):
.. versionadded:: 1.1
"""

#: list of allowed authentication types provided by the server (possible
#: values are: ``"none"``, ``"password"``, and ``"publickey"``).
allowed_types = []
Expand All @@ -72,6 +76,7 @@ class PartialAuthentication(AuthenticationException):
"""
An internal exception thrown in the case of partial authentication.
"""

allowed_types = []

def __init__(self, types):
Expand Down
3 changes: 2 additions & 1 deletion paramiko/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class Transport(threading.Thread, ClosingContextManager):
Instances of this class may be used as context managers.
"""

_ENCRYPT = object()
_DECRYPT = object()

Expand Down Expand Up @@ -2803,6 +2804,7 @@ class SecurityOptions(object):
``ValueError`` will be raised. If you try to assign something besides a
tuple to one of the fields, ``TypeError`` will be raised.
"""

__slots__ = "_transport"

def __init__(self, transport):
Expand Down Expand Up @@ -2872,7 +2874,6 @@ def compression(self, x):


class ChannelMap(object):

def __init__(self):
# (id -> Channel)
self._map = weakref.WeakValueDictionary()
Expand Down
2 changes: 0 additions & 2 deletions paramiko/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def log_to_file(filename, level=DEBUG):

# make only one filter object, so it doesn't get applied more than once
class PFilter(object):

def filter(self, record):
record._threadid = get_thread_id()
return True
Expand Down Expand Up @@ -295,7 +294,6 @@ def constant_time_bytes_eq(a, b):


class ClosingContextManager(object):

def __enter__(self):
return self

Expand Down
1 change: 1 addition & 0 deletions paramiko/win_pageant.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class COPYDATASTRUCT(ctypes.Structure):
ctypes implementation of
http://msdn.microsoft.com/en-us/library/windows/desktop/ms649010%28v=vs.85%29.aspx
"""

_fields_ = [
("num_data", ULONG_PTR),
("data_size", ctypes.wintypes.DWORD),
Expand Down
3 changes: 2 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def release(ctx, sdist=True, wheel=True, sign=True, dry_run=False, index=None):
"changelog_file": join(
www.configuration()["sphinx"]["source"], "changelog.rst"
),
}
},
"travis": {"black": {"version": "18.6b4"}},
}
)
2 changes: 0 additions & 2 deletions tests/stub_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@


class StubServer(ServerInterface):

def check_auth_password(self, username, password):
# all are allowed
return AUTH_SUCCESSFUL
Expand All @@ -48,7 +47,6 @@ def check_channel_request(self, kind, chanid):


class StubSFTPHandle(SFTPHandle):

def stat(self):
try:
return SFTPAttributes.from_stat(os.fstat(self.readfile.fileno()))
Expand Down
1 change: 0 additions & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def check_auth_interactive_response(self, responses):


class AuthTest(unittest.TestCase):

def setUp(self):
self.socks = LoopSocket()
self.sockc = LoopSocket()
Expand Down
1 change: 0 additions & 1 deletion tests/test_buffered_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def close_thread(p):


class BufferedPipeTest(unittest.TestCase):

def test_1_buffered_pipe(self):
p = BufferedPipe()
self.assertTrue(not p.read_ready())
Expand Down
3 changes: 0 additions & 3 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@


class NullServer(paramiko.ServerInterface):

def __init__(self, *args, **kwargs):
# Allow tests to enable/disable specific key types
self.__allowed_keys = kwargs.pop("allowed_keys", [])
Expand Down Expand Up @@ -115,7 +114,6 @@ def check_channel_env_request(self, channel, name, value):


class ClientTest(unittest.TestCase):

def setUp(self):
self.sockl = socket.socket()
self.sockl.bind(("localhost", 0))
Expand Down Expand Up @@ -230,7 +228,6 @@ def _test_connection(self, **kwargs):


class SSHClientTest(ClientTest):

def test_1_client(self):
"""
verify that the SSHClient stuff works too.
Expand Down
1 change: 0 additions & 1 deletion tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def _write(self, data):


class BufferedFileTest(unittest.TestCase):

def test_1_simple(self):
f = LoopbackFile("r")
try:
Expand Down
1 change: 0 additions & 1 deletion tests/test_gssapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

@needs_gssapi
class GSSAPITest(unittest.TestCase):

def setup():
# TODO: these vars should all come from os.environ or whatever the
# approved pytest method is for runtime-configuring test data.
Expand Down
1 change: 0 additions & 1 deletion tests/test_hostkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@


class HostKeysTest(unittest.TestCase):

def setUp(self):
with open("hostfile.temp", "w") as f:
f.write(test_hosts_file)
Expand Down
Loading

0 comments on commit 57201d2

Please sign in to comment.