From 2dcdba72cf79f8bc1a72426c879afedf1fa47f72 Mon Sep 17 00:00:00 2001 From: Jared Hobbs Date: Tue, 27 Nov 2018 18:01:19 -0700 Subject: blacken, tests --- paramiko/ecdsakey.py | 2 +- paramiko/pkey.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paramiko/ecdsakey.py b/paramiko/ecdsakey.py index 8b12520e..5f39867a 100644 --- a/paramiko/ecdsakey.py +++ b/paramiko/ecdsakey.py @@ -295,7 +295,7 @@ class ECDSAKey(PKey): curve, verkey, sigkey = self._uint32_cstruct_unpack(data, "sss") try: key = ec.derive_private_key(sigkey, curve, default_backend()) - except TypeError as e: + except (AttributeError, TypeError) as e: raise SSHException(str(e)) else: raise SSHException("unknown private key format.") diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 84424218..6839ccc4 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -481,14 +481,14 @@ class PKey(object): # string s_size = struct.unpack(">L", data[idx : idx + 4])[0] idx += 4 - s = data[idx:idx + s_size] + s = data[idx : idx + s_size] idx += s_size arr.append(s) if f == "i": # long integer s_size = struct.unpack(">L", data[idx : idx + 4])[0] idx += 4 - s = data[idx:idx + s_size] + s = data[idx : idx + s_size] idx += s_size i = util.inflate_long(s, True) arr.append(i) -- cgit v1.2.3