From 9b5b2a4cccb092bcb42ae2a5025ce21a3def4d60 Mon Sep 17 00:00:00 2001 From: tumbili Date: Tue, 3 Nov 2015 16:47:09 +0100 Subject: [PATCH] use correct Unix line ending character Conflicts: Tools/px_romfs_pruner.py --- Tools/px_romfs_pruner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/px_romfs_pruner.py b/Tools/px_romfs_pruner.py index 1fa1efbd90..a7984c66dd 100644 --- a/Tools/px_romfs_pruner.py +++ b/Tools/px_romfs_pruner.py @@ -40,7 +40,7 @@ Delete all comments and newlines before ROMFS is converted to an image """ from __future__ import print_function -import argparse +import argparse, re import os @@ -64,7 +64,7 @@ def main(): # read file line by line pruned_content = "" - with open(file_path, "r") as f: + with open(file_path, "rU") as f: for line in f: # handle mixer files differently than startup files @@ -76,6 +76,7 @@ def main(): pruned_content += line # overwrite old scratch file with open(file_path, "wb") as f: + pruned_content = re.sub("\r\n", "\n", pruned_content) f.write(pruned_content.encode("ascii", errors='strict'))