Some manual .format() -> f-strings

This commit is contained in:
Anthony Sottile 2020-01-12 11:13:39 -08:00
parent aefbe71765
commit 9000e9dd41
27 changed files with 133 additions and 173 deletions

View file

@ -39,7 +39,7 @@ def _process_filename_at_once(pattern: Pattern[bytes], filename: str) -> int:
if match:
retv = 1
line_no = contents[:match.start()].count(b'\n')
output.write('{}:{}:'.format(filename, line_no + 1))
output.write(f'{filename}:{line_no + 1}:')
matched_lines = match.group().split(b'\n')
matched_lines[0] = contents.split(b'\n')[line_no]