Skip to content
Snippets Groups Projects
Commit 177d14c8 authored by Julian Oes's avatar Julian Oes Committed by Beat Küng
Browse files

px_romfs_pruner.py: remove deprecation warning

The open flag `U` causes a deprecation warning starting with Python 3.4.
The option to open all kinds of newlines as `\n` has been replaced with
the argument `newline=None`. However, this argument is not available for
Python 2 unless we use `io.open` instead of `open`.
parent 1e17a86a
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ from __future__ import print_function
import argparse
import re
import os
import io
def main():
......@@ -88,7 +89,7 @@ def main():
# read file line by line
pruned_content = ""
board_excluded = False
with open(file_path, "rU") as f:
with io.open(file_path, "r", newline=None) as f:
for line in f:
if re.search(r'\b{0} exclude\b'.format(args.board),line):
board_excluded = True;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment