Skip to content

Commit 1dbdf94

Browse files
committed
Generate platform-specific FrozenModules.java line endings
1 parent a47def2 commit 1dbdf94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graalpython/com.oracle.graal.python.frozen/freeze_modules.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,21 +587,21 @@ def write_frozen_lookup(out_file, modules):
587587

588588
def write_frozen_module_file(file, modules):
589589
if os.path.exists(file):
590-
with open(file, "r", encoding="utf-8") as f:
590+
with open(file, "r", encoding="utf-8", newline=os.linesep) as f:
591591
content = f.read()
592592
stat_result = os.stat(file)
593593
atime, mtime = stat_result.st_atime, stat_result.st_mtime
594594
else:
595595
content = None
596596
os.makedirs(os.path.dirname(file), exist_ok=True)
597-
with open(file, "w", encoding="utf-8") as out_file:
597+
with open(file, "w", encoding="utf-8", newline=os.linesep) as out_file:
598598
out_file.write(FROZEN_MODULES_HEADER)
599599
out_file.write("\n\n")
600600
write_frozen_modules_map(out_file, modules)
601601
out_file.write("\n")
602602
write_frozen_lookup(out_file, modules)
603603
out_file.write("}\n")
604-
with open(file, "r", encoding="utf-8") as f:
604+
with open(file, "r", encoding="utf-8", newline=os.linesep) as f:
605605
new_content = f.read()
606606
if new_content == content:
607607
# set mtime to the old one, if we didn't change anything

0 commit comments

Comments
 (0)