mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix "TypeError : startswith first arg" when checking udev rules with PY3 // Resolve #2000
This commit is contained in:
@ -797,14 +797,10 @@ def merge_dicts(d1, d2, path=None):
|
|||||||
def ensure_udev_rules():
|
def ensure_udev_rules():
|
||||||
|
|
||||||
def _rules_to_set(rules_path):
|
def _rules_to_set(rules_path):
|
||||||
result = set([])
|
return set([
|
||||||
with open(rules_path, "rb") as fp:
|
l.strip() for l in get_file_contents(rules_path).split("\n")
|
||||||
for line in fp.readlines():
|
if l.strip() and not l.startswith("#")
|
||||||
line = line.strip()
|
])
|
||||||
if not line or line.startswith("#"):
|
|
||||||
continue
|
|
||||||
result.add(line)
|
|
||||||
return result
|
|
||||||
|
|
||||||
if "linux" not in get_systype():
|
if "linux" not in get_systype():
|
||||||
return None
|
return None
|
||||||
|
Reference in New Issue
Block a user