Skip to content

Commit 4445c25

Browse files
author
Leo Vasanko
committed
Always generate LF line endings (even on broken OS).
1 parent 04f1c30 commit 4445c25

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def generate_python_modules(
267267
if dst.exists() and dst.read_text(encoding="utf-8") == new_content:
268268
unchanged.append(dst)
269269
else:
270-
dst.write_text(new_content, encoding="utf-8")
270+
dst.write_bytes(new_content.encode())
271271
updated.append(dst)
272272

273273
return updated, unchanged
@@ -301,7 +301,7 @@ def main() -> int:
301301
if cdef_path.exists() and cdef_path.read_text(encoding="utf-8") == cdef_content:
302302
print(f" - No changes to {cdef_path}", file=sys.stderr)
303303
else:
304-
cdef_path.write_text(cdef_content, encoding="utf-8")
304+
cdef_path.write_bytes(cdef_content.encode())
305305
print(f" - Updated {cdef_path}", file=sys.stderr)
306306

307307
print("Step 3: Generating Python modules...", file=sys.stderr)

0 commit comments

Comments
 (0)