Skip to content

Commit

Permalink
Remove a few spots of old style string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Dec 3, 2019
1 parent 0e33705 commit 109b14c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion paramiko/dsskey.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _decode_key(self, data):
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)
Expand Down
6 changes: 3 additions & 3 deletions paramiko/pkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def _read_private_key(self, tag, f, password=None):
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
Expand Down Expand Up @@ -352,7 +352,7 @@ def _read_private_key_pem(self, lines, end, password):
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
Expand Down Expand Up @@ -394,7 +394,7 @@ def _read_private_key_openssh(self, lines, password):
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]
Expand Down

0 comments on commit 109b14c

Please sign in to comment.