Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change function format to f-string asv/commands/rm.py #1186

Merged
merged 1 commit into from
Mar 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions asv/commands/rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run(cls, conf, patterns, y=True):
for pattern in patterns:
parts = pattern.split('=', 1)
if len(parts) != 2:
raise util.UserError("Invalid pattern '{0}'".format(pattern))
raise util.UserError(f"Invalid pattern '{pattern}'")

if parts[0] == 'benchmark':
if single_benchmark is not None:
Expand All @@ -54,7 +54,7 @@ def run(cls, conf, patterns, y=True):
else:
if parts[0] in global_patterns:
raise util.UserError(
"'{0}' appears more than once".format(parts[0]))
f"'{parts[0]}' appears more than once")
global_patterns[parts[0]] = parts[1]

for result in iter_results(conf.results_dir):
Expand Down Expand Up @@ -87,10 +87,9 @@ def run(cls, conf, patterns, y=True):
files_to_remove.add(result)

if single_benchmark is not None:
log.info("Removing {0} benchmarks in {1} files".format(
count, len(files_to_remove)))
log.info(f"Removing {count} benchmarks in {len(files_to_remove)} files")
else:
log.info("Removing {0} files".format(len(files_to_remove)))
log.info(f"Removing {len(files_to_remove)} files")

if not y:
do = console.get_answer_default("Perform operations", "n")
Expand Down