diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-03-09 14:29:24 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-03-09 14:29:24 -0600 |
commit | d9fa40f2df44d775e82332577d44de402b23611f (patch) | |
tree | f9f95b4d52fbe79a9cd1ca1b0107b14cb7c9e45b /doc | |
parent | f28964805e44a5c068ce8fd9d1e00697fcd922dc (diff) | |
download | redot-engine-d9fa40f2df44d775e82332577d44de402b23611f.tar.gz |
Enforce `\n` eol for Python writes
• Ensure utf-8 encoding if previously unspecified
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/tools/make_rst.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index d871535a66..51d67d3456 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -891,9 +891,9 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: class_name = class_def.name if dry_run: - f = open(os.devnull, "w", encoding="utf-8") + f = open(os.devnull, "w", encoding="utf-8", newline="\n") else: - f = open(os.path.join(output_dir, f"class_{class_name.lower()}.rst"), "w", encoding="utf-8") + f = open(os.path.join(output_dir, f"class_{class_name.lower()}.rst"), "w", encoding="utf-8", newline="\n") # Remove the "Edit on Github" button from the online docs page. f.write(":github_url: hide\n\n") @@ -1691,9 +1691,9 @@ def make_link(url: str, title: str) -> str: def make_rst_index(grouped_classes: Dict[str, List[str]], dry_run: bool, output_dir: str) -> None: if dry_run: - f = open(os.devnull, "w", encoding="utf-8") + f = open(os.devnull, "w", encoding="utf-8", newline="\n") else: - f = open(os.path.join(output_dir, "index.rst"), "w", encoding="utf-8") + f = open(os.path.join(output_dir, "index.rst"), "w", encoding="utf-8", newline="\n") # Remove the "Edit on Github" button from the online docs page, and disallow user-contributed notes # on the index page. User-contributed notes are allowed on individual class pages. |