tools: Write generated files with UNIX line endings on all platforms (see #3627)

This commit is contained in:
Sergey Markelov 2023-12-26 13:36:48 -07:00 committed by Marshall Greenblatt
parent 7c2bd75f7a
commit 784302280b
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ def read_file(name, normalize=True):
def write_file(name, data):
""" Write a file. """
try:
with open(name, 'w', encoding='utf-8') as f:
with open(name, 'w', encoding='utf-8', newline='\n') as f:
# write the data
if sys.version_info.major == 2:
f.write(data.decode('utf-8'))