Skip empty serial ports // Issue #294

This commit is contained in:
Ivan Kravets
2015-10-02 16:20:07 +01:00
parent 3c36eafdfa
commit 2c0d26e06d

View File

@ -249,7 +249,8 @@ def get_serialports():
from serial.tools.list_ports_posix import comports
else:
raise exception.GetSerialPortsError(os.name)
return [{"port": p, "description": d, "hwid": h} for p, d, h in comports()]
return [{"port": p, "description": d, "hwid": h}
for p, d, h in comports() if p]
def get_logicaldisks():