mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 20:17:15 +00:00
use f-strings in module utils (#10901)
* use f-strings in module utils * Apply suggestions from code review Co-authored-by: Felix Fontein <felix@fontein.de> * remove unused imports --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
74b6a0294a
commit
b85e263466
51 changed files with 270 additions and 382 deletions
|
|
@ -47,7 +47,7 @@ class PackageRequirement:
|
|||
return req.name, req
|
||||
|
||||
except Exception as e:
|
||||
raise ValueError("Invalid package specification for '{0}': {1}".format(name, e)) from e
|
||||
raise ValueError(f"Invalid package specification for '{name}': {e}") from e
|
||||
|
||||
def matches_version(self, version):
|
||||
"""
|
||||
|
|
@ -68,4 +68,4 @@ class PackageRequirement:
|
|||
return ver in self.requirement.specifier
|
||||
|
||||
except InvalidVersion as e:
|
||||
raise ValueError("Invalid version '{0}': {1}".format(version, e)) from e
|
||||
raise ValueError(f"Invalid version '{version}': {e}") from e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue