🔨 More compatible Makefile (#28094)

This commit is contained in:
ellensp
2025-10-07 20:30:06 +13:00
committed by GitHub
parent 35da223f0a
commit ef3e9134dc
2 changed files with 34 additions and 10 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ def format_pins(argv):
file_text = sys.stdin.read()
else:
# Open and read the file src_file
with open(src_file, 'r', encoding='utf-8') as rf: file_text = rf.read()
with open(src_file, 'r', encoding='utf-8', newline='') as rf: file_text = rf.read()
if len(file_text) == 0:
print('No text to process')
@@ -86,7 +86,7 @@ def format_pins(argv):
# Read from file or STDIN until it terminates
filtered = process_text(file_text)
if dst_file:
with open(dst_file, 'w', encoding='utf-8') as wf: wf.write(filtered)
with open(dst_file, 'w', encoding='utf-8', newline='') as wf: wf.write(filtered)
else:
print(filtered)