use f-strings (#10899)

* use f-strings

* add changelog frag

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2025-10-11 22:59:28 +13:00 committed by GitHub
commit 3734f471c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 50 additions and 54 deletions

View file

@ -66,9 +66,7 @@ def hashids_encode(nums, salt=None, alphabet=None, min_length=None):
try:
hashid = hashids.encode(*nums)
except TypeError as e:
raise AnsibleTypeError(
"Data to encode must by a tuple or list of ints: %s" % to_native(e)
)
raise AnsibleTypeError(f"Data to encode must by a tuple or list of ints: {e}")
return hashid