diff options
author | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-06-06 04:10:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 10:10:23 +0200 |
commit | f8756edd025d9f4a88805feacb1a038e54840d02 (patch) | |
tree | 68a19841303b864b0f240cf1bc29f2f877903425 /pylint/pyreverse | |
parent | 6f896b95f3bc1ff740dc786413fbb3130c19b3da (diff) | |
download | pylint-git-f8756edd025d9f4a88805feacb1a038e54840d02.tar.gz |
Emit fewer DeprecationWarnings in pyreverse (#6869)
Diffstat (limited to 'pylint/pyreverse')
-rw-r--r-- | pylint/pyreverse/inspector.py | 15 |
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: |