Explicitly set newline when rewriting for release (#7600)

This commit is contained in:
Tzu-ping Chung 2020-01-19 02:45:20 +08:00 committed by Pradyun Gedam
parent f1cf84e2f8
commit c55eee4188
1 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,6 @@
These are written according to the order they are called in. These are written according to the order they are called in.
""" """
import io
import os import os
import subprocess import subprocess
from typing import List, Optional, Set from typing import List, Optional, Set
@ -70,7 +69,7 @@ def generate_authors(filename: str) -> None:
authors = get_author_list() authors = get_author_list()
# Write our authors to the AUTHORS file # Write our authors to the AUTHORS file
with io.open(filename, "w", encoding="utf-8") as fp: with open(filename, "w", encoding="utf-8", newline="\n") as fp:
fp.write(u"\n".join(authors)) fp.write(u"\n".join(authors))
fp.write(u"\n") fp.write(u"\n")
@ -90,7 +89,7 @@ def update_version_file(version: str, filepath: str) -> None:
content = list(f) content = list(f)
file_modified = False file_modified = False
with open(filepath, "w", encoding="utf-8") as f: with open(filepath, "w", encoding="utf-8", newline="\n") as f:
for line in content: for line in content:
if line.startswith("__version__ ="): if line.startswith("__version__ ="):
f.write('__version__ = "{}"\n'.format(version)) f.write('__version__ = "{}"\n'.format(version))