Replace % and str.format() with f-strings (#875)

* Replace % and str.format() with f-strings.

* Apply suggestions from review.
This commit is contained in:
Felix Fontein
2025-05-01 11:50:10 +02:00
committed by GitHub
parent d8f838c365
commit 641e63b08c
86 changed files with 544 additions and 1036 deletions

View File

@@ -259,7 +259,7 @@ def main():
)
)
except Exception as e:
raise ModuleFailException("Error while loading private key: {0}".format(e))
raise ModuleFailException(f"Error while loading private key: {e}")
# Some common attributes
domain = to_text(challenge_data["resource"])
@@ -276,7 +276,7 @@ def main():
san = cryptography.x509.IPAddress(ipaddress.ip_address(identifier))
else:
raise ModuleFailException(
'Unsupported identifier type "{0}"'.format(identifier_type)
f'Unsupported identifier type "{identifier_type}"'
)
# Generate regular self-signed certificate