From 4084189f0983fb203d9b33888fbbc350cd1814d3 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 29 Jun 2018 09:56:44 +0200 Subject: [PATCH] pylint: Class node has been renamed to ClassDef nodes.Class has been removed from pylint and astroid 2.0. The new names have been available for a while. Signed-off-by: Christian Heimes Reviewed-By: Alexander Bokovoy --- pylint_plugins.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pylint_plugins.py b/pylint_plugins.py index e7a5c7f4e..dc32e5a92 100644 --- a/pylint_plugins.py +++ b/pylint_plugins.py @@ -30,17 +30,17 @@ def _warning_already_exists(cls, member): def fake_class(name_or_class_obj, members=()): - if isinstance(name_or_class_obj, scoped_nodes.Class): + if isinstance(name_or_class_obj, scoped_nodes.ClassDef): cl = name_or_class_obj else: - cl = scoped_nodes.Class(name_or_class_obj, None) + cl = scoped_nodes.ClassDef(name_or_class_obj, None) for m in members: if isinstance(m, str): if m in cl.locals: _warning_already_exists(cl, m) else: - cl.locals[m] = [scoped_nodes.Class(m, None)] + cl.locals[m] = [scoped_nodes.ClassDef(m, None)] elif isinstance(m, dict): for key, val in m.items(): assert isinstance(key, str), "key must be string" @@ -265,7 +265,8 @@ def fix_ipa_classes(cls): if class_name_with_module in ipa_class_members: fake_class(cls, ipa_class_members[class_name_with_module]) -MANAGER.register_transform(scoped_nodes.Class, fix_ipa_classes) + +MANAGER.register_transform(scoped_nodes.ClassDef, fix_ipa_classes) def pytest_config_transform():