summaryrefslogtreecommitdiff
path: root/pylint/pyreverse
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-06-06 04:10:23 -0400
committerGitHub <noreply@github.com>2022-06-06 10:10:23 +0200
commitf8756edd025d9f4a88805feacb1a038e54840d02 (patch)
tree68a19841303b864b0f240cf1bc29f2f877903425 /pylint/pyreverse
parent6f896b95f3bc1ff740dc786413fbb3130c19b3da (diff)
downloadpylint-git-f8756edd025d9f4a88805feacb1a038e54840d02.tar.gz
Emit fewer DeprecationWarnings in pyreverse (#6869)
Diffstat (limited to 'pylint/pyreverse')
-rw-r--r--pylint/pyreverse/inspector.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py
index 8f0f9bcfc..042d3845e 100644
--- a/pylint/pyreverse/inspector.py
+++ b/pylint/pyreverse/inspector.py
@@ -187,13 +187,14 @@ class Linker(IdGeneratorMixIn, utils.LocalsVisitor):
ifaces = interfaces(node)
if ifaces is not None:
node.implements = list(ifaces)
- # TODO: 3.0: Remove support for __implements__
- warnings.warn(
- "pyreverse will drop support for resolving and displaying implemented interfaces in pylint 3.0. "
- "The implementation relies on the '__implements__' attribute proposed in PEP 245, which was rejected "
- "in 2006.",
- DeprecationWarning,
- )
+ if node.implements:
+ # TODO: 3.0: Remove support for __implements__
+ warnings.warn(
+ "pyreverse will drop support for resolving and displaying implemented interfaces in pylint 3.0. "
+ "The implementation relies on the '__implements__' attribute proposed in PEP 245, which was rejected "
+ "in 2006.",
+ DeprecationWarning,
+ )
else:
node.implements = []
except astroid.InferenceError: