Skip to content

Commit

Permalink
Revert replacing % with .format
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 4, 2023
1 parent 0c8a452 commit b0781c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rsa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def parse_cli(self) -> typing.Tuple[optparse.Values, typing.List[str]]:
def read_key(self, filename: str, keyform: str) -> rsa.key.AbstractKey:
"""Reads a public or private key."""

print("Reading {} key from {}".format(self.keyname, filename), file=sys.stderr)
print("Reading %s key from %s" % (self.keyname, filename), file=sys.stderr)
with open(filename, "rb") as keyfile:
keydata = keyfile.read()

Expand Down
2 changes: 1 addition & 1 deletion rsa/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _assert_format_exists(
except KeyError as ex:
formats = ", ".join(sorted(methods.keys()))
raise ValueError(
"Unsupported format: {!r}, try one of {}".format(file_format, formats)
"Unsupported format: %r, try one of %s" % (file_format, formats)
) from ex

def save_pkcs1(self, format: str = "PEM") -> bytes:
Expand Down
4 changes: 2 additions & 2 deletions rsa/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def private_to_public() -> None:
# Read the input data
if cli.infilename:
print(
"Reading private key from {} in {} format".format(cli.infilename, cli.inform),
"Reading private key from %s in %s format" % (cli.infilename, cli.inform),
file=sys.stderr,
)
with open(cli.infilename, "rb") as infile:
Expand All @@ -87,7 +87,7 @@ def private_to_public() -> None:

if cli.outfilename:
print(
"Writing public key to {} in {} format".format(cli.outfilename, cli.outform),
"Writing public key to %s in %s format" % (cli.outfilename, cli.outform),
file=sys.stderr,
)
with open(cli.outfilename, "wb") as outfile:
Expand Down

0 comments on commit b0781c3

Please sign in to comment.