Skip to content

Commit

Permalink
fix(fixers): reset offset between writes
Browse files Browse the repository at this point in the history
  • Loading branch information
guilatrova committed Sep 12, 2021
1 parent 3db7e05 commit dc3a070
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tryceratops/fixers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def read_lines(self) -> Iterable[str]:
def write_fix(self, new_lines: Iterable[str]):
self.file.writelines(new_lines)
self.file.truncate()
self.file.seek(0)

def __exit__(self, exc_type, exc_value, exc_traceback):
self.file.close()
Expand Down

0 comments on commit dc3a070

Please sign in to comment.