summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2023-04-24 00:54:41 +0200
committerGitHub <noreply@github.com>2023-04-24 00:54:41 +0200
commit66c90522ca89fbb3ea2429c749c48bcccbdce538 (patch)
treefd5f44e155e5c0d27b05577ea2bca08d39ff6217
parent7826795cb68dbc484f954d9a29101041ebf62119 (diff)
downloadpylint-git-66c90522ca89fbb3ea2429c749c48bcccbdce538.tar.gz
Use astroid.Context enum (#8611)
-rw-r--r--pylint/checkers/typecheck.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py
index 1c58efadb..0298c81dc 100644
--- a/pylint/checkers/typecheck.py
+++ b/pylint/checkers/typecheck.py
@@ -1692,9 +1692,9 @@ accessed. Python regular expressions are accepted.",
# 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 @@ accessed. Python regular expressions are accepted.",
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"