diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index 2981fc48..543d7429 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -787,12 +787,6 @@ def apply_augmentations(linter): # model forms have no __init__ method anywhere in their bases suppress_message(linter, ClassChecker.visit_classdef, 'W0232', is_class('django.forms.models.ModelForm')) - # forms implement __getitem__ but not __len__, thus raising a "Badly implemented container" warning which - # we will suppress. NOTE: removed from pylint, https://github.com/PyCQA/pylint/issues/112 - # keeping here in case it gets re-implemented - # suppress_message(linter, _leave_classdef(MisdesignChecker), 'R0924', is_class('django.forms.forms.Form')) - # suppress_message(linter, _leave_classdef(MisdesignChecker), 'R0924', is_class('django.forms.models.ModelForm')) - # Meta suppress_message(linter, DocStringChecker.visit_classdef, 'missing-docstring', is_model_meta_subclass) pylint_newstyle_classdef_compat(linter, 'old-style-class', is_model_meta_subclass) diff --git a/pylint_django/compat.py b/pylint_django/compat.py index 6d70e2bc..590cd8f2 100644 --- a/pylint_django/compat.py +++ b/pylint_django/compat.py @@ -13,6 +13,7 @@ Getattr as Attribute, ) +# pylint 2.04->2.2 : YES was renamed to Uninferable, then YES became deprecated, then was removed try: from astroid.bases import YES as Uninferable except ImportError: @@ -21,23 +22,3 @@ except ImportError: from astroid.util import Uninferable -try: - django = __import__("django") - django_version = django.VERSION -except ImportError: - # if not available, will be handled by the django_installed checker - django_version = (1, 5) - - -def inferred(node): - if hasattr(node, "inferred"): - return node.inferred - else: - return node.infered - - -def instantiate_class(node): - if hasattr(node, "instantiate_class"): - return node.instantiate_class - else: - return node.instanciate_class