tools: Write generated files with UNIX line endings on all platforms (see #3627)
This commit is contained in:
parent
7c2bd75f7a
commit
784302280b
|
@ -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'))
|
||||
|
|
Loading…
Reference in New Issue