summaryrefslogtreecommitdiff
path: root/pylint/checkers/python3.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-27 15:21:29 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-28 16:30:10 +0200
commit14f20e2d50b71d92893edda67c00054a840ee05f (patch)
tree35b161bc220c74578068f1392458bc4ef9c475f4 /pylint/checkers/python3.py
parentd2db40c08433ca35dc9e5312e1d1b6404db65c33 (diff)
downloadpylint-git-14f20e2d50b71d92893edda67c00054a840ee05f.tar.gz
Import astroid with import x or from x import y but not both
Remove unused imports for astroid
Diffstat (limited to 'pylint/checkers/python3.py')
-rw-r--r--pylint/checkers/python3.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py
index d3943ad37..fdc6590b0 100644
--- a/pylint/checkers/python3.py
+++ b/pylint/checkers/python3.py
@@ -43,7 +43,6 @@ import tokenize
from collections import namedtuple
import astroid
-from astroid import bases
from pylint import checkers, interfaces
from pylint.checkers import utils
@@ -978,7 +977,9 @@ class Python3Checker(checkers.BaseChecker):
# classmethod 1 argument should cause a failure, if it is a
# staticmethod 0 arguments should cause a failure.
failing_arg_count = 1
- if utils.decorated_with(node, [bases.BUILTINS + ".staticmethod"]):
+ if utils.decorated_with(
+ node, [astroid.bases.BUILTINS + ".staticmethod"]
+ ):
failing_arg_count = 0
if len(node.args.args) == failing_arg_count:
self.add_message("next-method-defined", node=node)
@@ -1116,7 +1117,7 @@ class Python3Checker(checkers.BaseChecker):
if not inferred:
return
- builtins_list = f"{bases.BUILTINS}.list"
+ builtins_list = f"{astroid.bases.BUILTINS}.list"
if isinstance(inferred, astroid.List) or inferred.qname() == builtins_list:
kwargs = node.keywords
@@ -1125,7 +1126,7 @@ class Python3Checker(checkers.BaseChecker):
if not inferred:
return
- builtins_sorted = f"{bases.BUILTINS}.sorted"
+ builtins_sorted = f"{astroid.bases.BUILTINS}.sorted"
if inferred.qname() == builtins_sorted:
kwargs = node.keywords