Skip to content

Commit 66c9052

Browse files
authored
Use astroid.Context enum (#8611)
1 parent 7826795 commit 66c9052

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pylint/checkers/typecheck.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,9 +1692,9 @@ def _check_invalid_sequence_index(self, subscript: nodes.Subscript) -> None:
16921692
# Determine what method on the parent this index will use
16931693
# The parent of this node will be a Subscript, and the parent of that
16941694
# node determines if the Subscript is a get, set, or delete operation.
1695-
if subscript.ctx is astroid.Store:
1695+
if subscript.ctx is astroid.Context.Store:
16961696
methodname = "__setitem__"
1697-
elif subscript.ctx is astroid.Del:
1697+
elif subscript.ctx is astroid.Context.Del:
16981698
methodname = "__delitem__"
16991699
else:
17001700
methodname = "__getitem__"
@@ -2116,13 +2116,13 @@ def visit_subscript(self, node: nodes.Subscript) -> None:
21162116
confidence=INFERENCE,
21172117
)
21182118

2119-
if node.ctx == astroid.Load:
2119+
if node.ctx == astroid.Context.Load:
21202120
supported_protocol = supports_getitem
21212121
msg = "unsubscriptable-object"
2122-
elif node.ctx == astroid.Store:
2122+
elif node.ctx == astroid.Context.Store:
21232123
supported_protocol = supports_setitem
21242124
msg = "unsupported-assignment-operation"
2125-
elif node.ctx == astroid.Del:
2125+
elif node.ctx == astroid.Context.Del:
21262126
supported_protocol = supports_delitem
21272127
msg = "unsupported-delete-operation"
21282128

0 commit comments

Comments
 (0)