2424from pylint .checkers .variables import ScopeConsumer , VariablesChecker
2525from pylint_plugin_utils import augment_visit , suppress_message
2626
27- from pylint_django .utils import PY3 , node_is_subclass
27+ from pylint_django .utils import node_is_subclass
2828
2929# Note: it would have been nice to import the Manager object from Django and
3030# get its attributes that way - and this used to be the method - but unfortunately
@@ -317,7 +317,7 @@ def ignore_import_warnings_for_related_fields(orig_method, self, node):
317317
318318 new_things = {}
319319
320- iterat = consumer .to_consume .items if PY3 else consumer . to_consume . iteritems
320+ iterat = consumer .to_consume .items
321321 for name , stmts in iterat ():
322322 if isinstance (stmts [0 ], ImportFrom ):
323323 if any (n [0 ] in ("ForeignKey" , "OneToOneField" ) for n in stmts [0 ].names ):
@@ -363,7 +363,7 @@ class ModelB(models.Model):
363363 quack = False
364364
365365 if node .attrname in MANAGER_ATTRS or node .attrname .endswith ("_set" ):
366- # if this is a X_set method, that's a pretty strong signal that this is the default
366+ # if this is an X_set method, that's a pretty strong signal that this is the default
367367 # Django name, rather than one set by related_name
368368 quack = True
369369 # we will
@@ -651,7 +651,7 @@ def __call__(self, node):
651651
652652
653653def is_model_view_subclass_method_shouldnt_be_function (node ):
654- """Checks that node is a default http method (i.e get, post, put, and more) of the View class."""
654+ """Checks that node is a default http method (i.e. get, post, put, and more) of the View class."""
655655 if node .name not in View .http_method_names :
656656 return False
657657
@@ -672,8 +672,9 @@ def ignore_unused_argument_warnings_for_request(orig_method, self, stmt, name):
672672 """
673673 Ignore unused-argument warnings for function arguments named "request".
674674
675- The signature of Django view functions require the request argument but it is okay if the request is not used.
676- This function should be used as a wrapper for the `VariablesChecker._is_name_ignored` method.
675+ The signature of Django view functions require the request argument, but
676+ it is okay if the request is not used. This function should be used as a
677+ wrapper for the `VariablesChecker._is_name_ignored` method.
677678 """
678679 if name in ("request" , "args" , "kwargs" ):
679680 return True
0 commit comments