Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions source/hwPortUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ def __str__(self):
# #6015: In some rare cases, this value doesn't exist.
log.debugWarning("No PortName value for hardware ID %s" % hwID)
continue
if not port:
log.debugWarning("Empty PortName value for hardware ID %s" % hwID)
continue
if hwID.startswith("BTHENUM\\"):
# This is a Microsoft bluetooth port.
try:
Expand Down Expand Up @@ -229,9 +232,9 @@ def __str__(self):
ctypes.byref(buf), ctypes.sizeof(buf) - 1,
None
):
# Ignore ERROR_INSUFFICIENT_BUFFER
if ctypes.GetLastError() != ERROR_INSUFFICIENT_BUFFER:
raise ctypes.WinError()
# #6007: SPDRP_FRIENDLYNAME sometimes doesn't exist/isn't valid.
log.debugWarning("Couldn't get SPDRP_FRIENDLYNAME for %s: %s" % (port, ctypes.WinError()))
entry["friendlyName"] = port
else:
entry["friendlyName"] = buf.value

Expand Down