aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-04-07 09:37:16 +0800
committerfanquake <fanquake@gmail.com>2021-05-04 20:47:59 +0800
commit7e7eae7aa86ab95c44eed601f8c993285a256bbc (patch)
treef6854a99d5577a681978a0246fa3edd4136e81f0
parent2e7a9f7ade0c7b31e762c0ddb9e0944a0d9c798e (diff)
contrib: use f strings in security-check.py
-rwxr-xr-xcontrib/devtools/security-check.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/devtools/security-check.py b/contrib/devtools/security-check.py
index 7b09c42fde..7a0761ad15 100755
--- a/contrib/devtools/security-check.py
+++ b/contrib/devtools/security-check.py
@@ -285,24 +285,24 @@ def identify_executable(executable) -> Optional[str]:
return None
if __name__ == '__main__':
- retval = 0
+ retval: int = 0
for filename in sys.argv[1:]:
try:
etype = identify_executable(filename)
if etype is None:
- print('%s: unknown format' % filename)
+ print(f'{filename}: unknown format')
retval = 1
continue
- failed = []
+ failed: List[str] = []
for (name, func) in CHECKS[etype]:
if not func(filename):
failed.append(name)
if failed:
- print('%s: failed %s' % (filename, ' '.join(failed)))
+ print(f'{filename}: failed {" ".join(failed)}')
retval = 1
except IOError:
- print('%s: cannot open' % filename)
+ print(f'{filename}: cannot open')
retval = 1
sys.exit(retval)