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
4 changes: 2 additions & 2 deletions ev3dev/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Device(object):

DEVICE_ROOT_PATH = '/sys/class'

_DEVICE_INDEX = re.compile(r'^.*(?P<idx>\d+)$')
_DEVICE_INDEX = re.compile(r'^.*(\d+)$')

def __init__(self, class_name, name_pattern='*', name_exact=False, **kwargs):
"""Spin through the Linux sysfs class for the device type and find
Expand Down Expand Up @@ -142,7 +142,7 @@ def __init__(self, class_name, name_pattern='*', name_exact=False, **kwargs):
def get_index(file):
match = Device._DEVICE_INDEX.match(file)
if match:
return int(match.group('idx'))
return int(match.group(1))
else:
return None

Expand Down