From e13b145dcdfa40e6934a38285cc9514e92f12c7a Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 24 Apr 2023 00:42:52 +0200 Subject: [PATCH] Use astroid.Context enum --- pylint/checkers/typecheck.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index 1c58efadb7..0298c81dc0 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -1692,9 +1692,9 @@ def _check_invalid_sequence_index(self, subscript: nodes.Subscript) -> None: # Determine what method on the parent this index will use # The parent of this node will be a Subscript, and the parent of that # node determines if the Subscript is a get, set, or delete operation. - if subscript.ctx is astroid.Store: + if subscript.ctx is astroid.Context.Store: methodname = "__setitem__" - elif subscript.ctx is astroid.Del: + elif subscript.ctx is astroid.Context.Del: methodname = "__delitem__" else: methodname = "__getitem__" @@ -2116,13 +2116,13 @@ def visit_subscript(self, node: nodes.Subscript) -> None: confidence=INFERENCE, ) - if node.ctx == astroid.Load: + if node.ctx == astroid.Context.Load: supported_protocol = supports_getitem msg = "unsubscriptable-object" - elif node.ctx == astroid.Store: + elif node.ctx == astroid.Context.Store: supported_protocol = supports_setitem msg = "unsupported-assignment-operation" - elif node.ctx == astroid.Del: + elif node.ctx == astroid.Context.Del: supported_protocol = supports_delitem msg = "unsupported-delete-operation"