summaryrefslogtreecommitdiff
path: root/pylint/extensions/bad_builtin.py
diff options
context:
space:
mode:
authorDaniël van Noord <13665637+DanielNoord@users.noreply.github.com>2022-04-02 12:20:59 +0200
committerDaniël van Noord <13665637+DanielNoord@users.noreply.github.com>2022-04-02 13:07:35 +0200
commitd9b74d913e46ba36f4dbe21be5d6d3c719a04824 (patch)
treee2fe89228cca6f4539c7151c21d918243995a987 /pylint/extensions/bad_builtin.py
parentfb8c75159e185b29b09998cac0cd52c06c216d1a (diff)
downloadpylint-git-d9b74d913e46ba36f4dbe21be5d6d3c719a04824.tar.gz
Use ``argparse`` config handler in all extensions
Diffstat (limited to 'pylint/extensions/bad_builtin.py')
-rw-r--r--pylint/extensions/bad_builtin.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pylint/extensions/bad_builtin.py b/pylint/extensions/bad_builtin.py
index 259df6e95..b3b3c7bdc 100644
--- a/pylint/extensions/bad_builtin.py
+++ b/pylint/extensions/bad_builtin.py
@@ -48,6 +48,9 @@ class BadBuiltinChecker(BaseChecker):
),
)
+ def __init__(self, linter: "PyLinter") -> None:
+ super().__init__(linter, future_option_parsing=True)
+
@check_messages("bad-builtin")
def visit_call(self, node: nodes.Call) -> None:
if isinstance(node.func, nodes.Name):
@@ -55,7 +58,7 @@ class BadBuiltinChecker(BaseChecker):
# ignore the name if it's not a builtin (i.e. not defined in the
# locals nor globals scope)
if not (name in node.frame(future=True) or name in node.root()):
- if name in self.config.bad_functions:
+ if name in self.linter.namespace.bad_functions:
hint = BUILTIN_HINTS.get(name)
args = f"{name!r}. {hint}" if hint else repr(name)
self.add_message("bad-builtin", node=node, args=args)