summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2019-12-03 16:38:36 -0500
committerJeff Forcier <jeff@bitprophet.org>2019-12-03 16:38:36 -0500
commit109b14c6510d85df935a546a5fe32f1f069cc2b2 (patch)
treede76ec05a8cb5170ad12ae75acfa346eeeb5a46c
parent0e337055cbd65de8f411e1d07f19a40b19cd44f7 (diff)
Remove a few spots of old style string formatting
-rw-r--r--paramiko/dsskey.py2
-rw-r--r--paramiko/pkey.py6
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]