summaryrefslogtreecommitdiff
path: root/pylint/checkers/classes.py
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2020-09-27 11:12:42 +0200
committerhippo91 <guillaume.peillex@gmail.com>2020-09-27 11:12:42 +0200
commitbdd4a8d402fe1fd7b6fe0adc17a3818350ec7d0d (patch)
treee92106ea53c616cb67b33cf190ad74cf0ef8ede4 /pylint/checkers/classes.py
parentc93dda29f4ea541942619e440f2cfabb12b37c96 (diff)
downloadpylint-git-bdd4a8d402fe1fd7b6fe0adc17a3818350ec7d0d.tar.gz
Taking into account @Pierre-Sassoulas remarks
Diffstat (limited to 'pylint/checkers/classes.py')
-rw-r--r--pylint/checkers/classes.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py
index 90a8fa6f4..151d8ebe6 100644
--- a/pylint/checkers/classes.py
+++ b/pylint/checkers/classes.py
@@ -1427,12 +1427,14 @@ a metaclass class method.",
if _is_attribute_property(name, klass):
return
- if not self.config.check_protected_access_in_special_methods:
+ if (
+ not self.config.check_protected_access_in_special_methods
+ and
# A licit use of protected member is inside a special method
- if not attrname.startswith(
- "__"
- ) and self._is_called_inside_special_method(node):
- return
+ not attrname.startswith("__")
+ and self._is_called_inside_special_method(node)
+ ):
+ return
self.add_message("protected-access", node=node, args=attrname)