@@ -587,21 +587,21 @@ def write_frozen_lookup(out_file, modules):
587
587
588
588
def write_frozen_module_file (file , modules ):
589
589
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 :
591
591
content = f .read ()
592
592
stat_result = os .stat (file )
593
593
atime , mtime = stat_result .st_atime , stat_result .st_mtime
594
594
else :
595
595
content = None
596
596
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 :
598
598
out_file .write (FROZEN_MODULES_HEADER )
599
599
out_file .write ("\n \n " )
600
600
write_frozen_modules_map (out_file , modules )
601
601
out_file .write ("\n " )
602
602
write_frozen_lookup (out_file , modules )
603
603
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 :
605
605
new_content = f .read ()
606
606
if new_content == content :
607
607
# set mtime to the old one, if we didn't change anything
0 commit comments