From 29ac57f565ac94021dee46b365daa56a3d27333e Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Tue, 10 Oct 2017 18:24:34 -0700 Subject: String format modernization, part 1 Choosing to skip it in some edge/corner cases where it's more harmful than helpful. Also choosing to replace many non-%s specifiers with regular old {} since I don't see why one would normally care. Again, eschewing that in spots where it seems like it might matter. --- paramiko/pkey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'paramiko/pkey.py') diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 533d0797..ae01dca2 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -312,14 +312,14 @@ class PKey(object): # encrypted keyfile: will need a password if headers['proc-type'] != '4,ENCRYPTED': raise SSHException( - 'Unknown private key structure "%s"' % headers['proc-type']) + 'Unknown private key structure "{}"'.format(headers['proc-type'])) try: encryption_type, saltstr = headers['dek-info'].split(',') except: raise SSHException("Can't parse DEK-info in private key file") if encryption_type not in self._CIPHER_TABLE: raise SSHException( - 'Unknown private key cipher "%s"' % encryption_type) + 'Unknown private key cipher "{}"'.format(encryption_type)) # if no password was passed in, # raise an exception pointing out that we need one if password is None: -- cgit v1.2.1