Merge pull request #484 from mxr/flake8-comprehensions

Fix C407
This commit is contained in:
Anthony Sottile 2020-05-18 16:19:13 -07:00 committed by GitHub
commit e75e18033d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ FAIL = 1
def sort_file_contents(f: IO[bytes]) -> int:
before = list(f)
after = sorted([line.strip(b'\n\r') for line in before if line.strip()])
after = sorted(line.strip(b'\n\r') for line in before if line.strip())
before_string = b''.join(before)
after_string = b'\n'.join(after) + b'\n'