Skip to content

Commit

Permalink
snekde: If the serial port name is None, use device
Browse files Browse the repository at this point in the history
Mac OS X doesn't provide a value for port.name

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Mar 31, 2019
1 parent 978d8df commit 2f889a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion snekde/snekde.py
Expand Up @@ -101,8 +101,13 @@ def __init__(self, port):
self.description = port[2]
else:
self.device = port.device
self.name = port.name
if port.name:
self.name = port.name
else:
self.name = self.device
self.description = port.description
if self.name and '/' in self.name:
self.name = self.name[self.name.rfind('/')+1:]

# A special hack for pre-3.5 pySerial
#
Expand Down

0 comments on commit 2f889a7

Please sign in to comment.