diff options
-rw-r--r-- | paramiko/dsskey.py | 2 | ||||
-rw-r--r-- | paramiko/pkey.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py index 4d85b8ca..7e74836c 100644 --- a/paramiko/dsskey.py +++ b/paramiko/dsskey.py @@ -236,7 +236,7 @@ class DSSKey(PKey): try: keylist = BER(data).decode() except BERException as e: - raise SSHException("Unable to parse key file: " + str(e)) + raise SSHException("Unable to parse key file: {}".format(e)) elif pkformat == self._PRIVATE_KEY_FORMAT_OPENSSH: keylist = self._uint32_cstruct_unpack(data, "iiiii") keylist = [0] + list(keylist) diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 312d0540..0dbe97fc 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -309,7 +309,7 @@ class PKey(object): start += 1 keytype = m.group(1) if m else None if start >= len(lines) or keytype is None: - raise SSHException("not a valid " + tag + " private key file") + raise SSHException("not a valid {} private key file".format(tag)) # find the END tag end = start @@ -352,7 +352,7 @@ class PKey(object): try: data = decodebytes(b("".join(lines[start:end]))) except base64.binascii.Error as e: - raise SSHException("base64 decoding error: " + str(e)) + raise SSHException("base64 decoding error: {}".format(e)) if "proc-type" not in headers: # unencryped: done return data @@ -394,7 +394,7 @@ class PKey(object): try: data = decodebytes(b("".join(lines))) except base64.binascii.Error as e: - raise SSHException("base64 decoding error: " + str(e)) + raise SSHException("base64 decoding error: {}".format(e)) # read data struct auth_magic = data[:14] |