mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
Revert "hwdb/parse_hwdb.py: open files with UTF-8 mode"
"encoding" is not a valid Python 2 keyword, and despite the hashbang this
script can be called with Python 2.
This reverts commit 115a10c58d
.
This commit is contained in:
parent
28d329571a
commit
2f08ccc32e
@ -133,8 +133,7 @@ def convert_properties(group):
|
|||||||
def parse(fname):
|
def parse(fname):
|
||||||
grammar = hwdb_grammar()
|
grammar = hwdb_grammar()
|
||||||
try:
|
try:
|
||||||
with open(fname, 'r', encoding='UTF-8') as f:
|
parsed = grammar.parseFile(fname)
|
||||||
parsed = grammar.parseFile(f)
|
|
||||||
except ParseBaseException as e:
|
except ParseBaseException as e:
|
||||||
error('Cannot parse {}: {}', fname, e)
|
error('Cannot parse {}: {}', fname, e)
|
||||||
return []
|
return []
|
||||||
|
Loading…
Reference in New Issue
Block a user