Skip to content

Commit

Permalink
Emit fewer DeprecationWarnings in pyreverse (#6869)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls authored and Pierre-Sassoulas committed Jun 6, 2022
1 parent 5913cb7 commit 7643fd1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pylint/pyreverse/inspector.py
Expand Up @@ -187,13 +187,14 @@ def visit_classdef(self, node: nodes.ClassDef) -> None:
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:
Expand Down

0 comments on commit 7643fd1

Please sign in to comment.