Fix PyLint warning

This commit is contained in:
Ivan Kravets
2019-01-11 14:07:35 +02:00
parent f058b8f18f
commit d627a42268

View File

@ -794,6 +794,15 @@ def merge_dicts(d1, d2, path=None):
return d1
def get_file_contents(path):
try:
with open(path) as f:
return f.read()
except UnicodeDecodeError:
with open(path, encoding="latin-1") as f:
return f.read()
def ensure_udev_rules():
def _rules_to_set(rules_path):