chore: fix linter errors (#25996)

This commit is contained in:
David Sanders 2020-10-19 04:55:27 -07:00 committed by GitHub
parent 05b5c197ae
commit c27e5fdbb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 20 deletions

View file

@ -12,7 +12,8 @@ def read_patch(patch_dir, patch_filename):
patch_path = os.path.join(patch_dir, patch_filename)
with codecs.open(patch_path, encoding='utf-8') as f:
for l in f.readlines():
if not added_filename_line and (l.startswith('diff -') or l.startswith('---')):
line_has_correct_start = l.startswith('diff -') or l.startswith('---')
if not added_filename_line and line_has_correct_start:
ret.append('Patch-Filename: {}\n'.format(patch_filename))
added_filename_line = True
ret.append(l)