Skip to content

Commit e3e25cd

Browse files
Fixed some linter errors
1 parent 460b627 commit e3e25cd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

adafruit_ble/advertising/standard.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ def __init__(self, key, value_format, field_names=None):
269269
self._entry_length = struct.calcsize(value_format)
270270
self.field_names = field_names
271271
if field_names:
272-
# Mostly, this is to raise a ValueError if the passed-in field_names has invalid entries for later use.
273-
self.MDFTuple = namedtuple("MDFTuple", self.field_names)
272+
# Mostly, this is to raise a ValueError if field_names has invalid entries
273+
self.mdf_tuple = namedtuple("mdf_tuple", self.field_names)
274274

275275
def __get__(self, obj, cls):
276276
if obj is None:
@@ -283,11 +283,10 @@ def __get__(self, obj, cls):
283283
if self.element_count == 1:
284284
unpacked = unpacked[0]
285285
if self.field_names and len(self.field_names) == len(unpacked):
286-
# If we have field names, use them to make a namedtuple, and we should already have that defined.
286+
# If we have field names, we should already have a namedtuple type to use
287287
# Unless the element count is off, which... werid.
288-
return self.MDFTuple(*unpacked)
289-
else:
290-
return unpacked
288+
return self.mdf_tuple(*unpacked)
289+
return unpacked
291290
if len(packed) % self._entry_length != 0:
292291
raise RuntimeError("Invalid data length")
293292
entry_count = len(packed) // self._entry_length

0 commit comments

Comments
 (0)