Fix empty list with serial ports on Mac OS X // Resolve #294

This commit is contained in:
Ivan Kravets
2015-11-17 23:20:04 +02:00
parent aa98d7dc5d
commit 5454c35430
3 changed files with 10 additions and 3 deletions

View File

@@ -30,6 +30,8 @@ PlatformIO 2.0
* Fixed project generator for CLion IDE under Windows OS with invalid path to
executable
(`issue #326 <https://github.com/platformio/platformio/issues/326>`_)
* Fixed empty list with serial ports on Mac OS X
(`issue #294 <https://github.com/platformio/platformio/issues/294>`_)
2.3.4 (2015-10-13)
~~~~~~~~~~~~~~~~~~

View File

@@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
VERSION = (2, 4, "0.dev3")
VERSION = (2, 4, "0.dev4")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@@ -247,8 +247,13 @@ def get_serialports():
from serial.tools.list_ports import comports
except ImportError:
raise exception.GetSerialPortsError(os.name)
return [{"port": p, "description": d, "hwid": h}
for p, d, h in comports() if p]
result = [{"port": p, "description": d, "hwid": h}
for p, d, h in comports() if p]
# fix for PySerial
if not result and system() == "Darwin":
for p in glob("/dev/tty.*"):
result.append({"port": p, "description": "", "hwid": ""})
return result
def get_logicaldisks():