diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2013-10-11 01:51:40 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2013-10-11 01:51:40 +0000 |
commit | 6de9e95339c3b4c2c5f05803cb935995cccaf243 (patch) | |
tree | 03db694f86ee2b3812388adf5bb27f4f96bf7897 /serial | |
parent | 1d7799e5530ffa5877bacaada4481645ee427966 (diff) | |
download | pyserial-6de9e95339c3b4c2c5f05803cb935995cccaf243.tar.gz |
[Bug pyserial:125] Undefined 'base' on list_ports_posix.py, function usb_lsusb
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@467 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial')
-rw-r--r-- | serial/tools/list_ports_posix.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/serial/tools/list_ports_posix.py b/serial/tools/list_ports_posix.py index 974c037..3e2da72 100644 --- a/serial/tools/list_ports_posix.py +++ b/serial/tools/list_ports_posix.py @@ -68,9 +68,10 @@ if plat[:5] == 'linux': # Linux (confirmed) )
def usb_lsusb_string(sysfs_path):
- base = os.path.basename(os.path.realpath(sysfs_path))
- bus, dev = base.split('-')
+ base = os.path.basename(os.path.realpath(sysfs_path))
+ bus = base.split('-')[0]
try:
+ dev = int(open(os.path.join(sysfs_path, 'devnum')).readline().strip())
desc = popen(['lsusb', '-v', '-s', '%s:%s' % (bus, dev)])
# descriptions from device
iManufacturer = re_group('iManufacturer\s+\w+ (.+)', desc)
|