Skip to content

Commit

Permalink
[bugfix] strip newlines from pairsfile lines
Browse files Browse the repository at this point in the history
Bug: T378647
Change-Id: I7c07398dfdcc80d3a0a45b4151438819c4d96cec
  • Loading branch information
xqt committed Oct 31, 2024
1 parent 38aeb04 commit fa9500e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,7 @@ def handle_pairsfile(filename: str) -> list[str] | None:
'Please enter the filename to read replacements from:')

try:
with Path(filename).open(encoding='utf-8') as f:
replacements = f.readlines()
replacements = Path(filename).read_text(encoding='utf-8').splitlines()
if not replacements:
raise OSError(f'{filename} is empty.')
except OSError as e:
Expand Down

0 comments on commit fa9500e

Please sign in to comment.