mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fix PyLint's "misplaced-comparison-constant"
This commit is contained in:
@ -283,9 +283,9 @@ def exec_command(*args, **kwargs):
|
||||
def get_serialports(use_grep=False):
|
||||
|
||||
def _grep_serial_ports():
|
||||
assert "Windows" != system()
|
||||
assert system() != "Windows"
|
||||
result = []
|
||||
if "Linux" == system():
|
||||
if system() == "Linux":
|
||||
patterns = ["/dev/%s*" % p for p in (
|
||||
"ttyS", "ttyUSB", "ttyACM", "ttyAMA", "rfcomm", "ttyO")]
|
||||
else:
|
||||
@ -295,7 +295,7 @@ def get_serialports(use_grep=False):
|
||||
result.append({"port": port, "description": "", "hwid": ""})
|
||||
return result
|
||||
|
||||
if use_grep and "Windows" != system():
|
||||
if use_grep and system() != "Windows":
|
||||
return _grep_serial_ports()
|
||||
|
||||
try:
|
||||
@ -307,7 +307,7 @@ def get_serialports(use_grep=False):
|
||||
for p, d, h in comports():
|
||||
if not p:
|
||||
continue
|
||||
if "Windows" == system():
|
||||
if system() == "Windows":
|
||||
try:
|
||||
d = unicode(d, errors="ignore")
|
||||
except TypeError:
|
||||
@ -315,7 +315,7 @@ def get_serialports(use_grep=False):
|
||||
result.append({"port": p, "description": d, "hwid": h})
|
||||
|
||||
# fix for PySerial
|
||||
if not result and "Windows" != system():
|
||||
if not result and system() != "Windows":
|
||||
result = _grep_serial_ports()
|
||||
|
||||
return result
|
||||
|
Reference in New Issue
Block a user