From b188a05b695a8b4b6635bd7e963511a25f4bb5d4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 2 Jun 2016 00:14:02 +0300 Subject: [PATCH] Fix PyLint's "misplaced-comparison-constant" --- platformio/util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platformio/util.py b/platformio/util.py index 39f3ad06..07966d2c 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -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