Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better target DeprecationWarnings in pyreverse #6869

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions pylint/pyreverse/inspector.py
Original file line number Diff line number Diff line change
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