Skip to content

Commit

Permalink
Ignore false Pylint errors for Enum subclasses
Browse files Browse the repository at this point in the history
Pylint does not see __members__ as existing or subscribable.

Maybe see also: pylint-dev/pylint#1498
  • Loading branch information
VladimirSlavik committed Feb 23, 2021
1 parent a59ff6d commit 13f061d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyanaconda/core/configuration/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PartitioningScheme(Enum):
def from_name(cls, value):
"""Convert the given value into a partitioning scheme."""
try:
member = cls.__members__[value]
member = cls.__members__[value] # pylint: disable=unsubscriptable-object
return member.value
except KeyError:
pass
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/configuration/storage_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DeviceType(Enum):
def from_name(cls, value):
"""Convert the given value into a device type."""
try:
member = cls.__members__[value]
member = cls.__members__[value] # pylint: disable=unsubscriptable-object
return member.value
except KeyError:
pass
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/payload/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self):
self._error = None

# Initialize a list for each event state
for _name, value in PayloadState.__members__.items():
for _name, value in PayloadState.__members__.items(): # pylint: disable=no-member
self._event_listeners[PayloadState(value)] = []

@property
Expand Down

0 comments on commit 13f061d

Please sign in to comment.