"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pylint/checkers/newstyle.py" between
pylint-2.14.2.tar.gz and pylint-2.14.3.tar.gz

About: pylint analyzes Python source code looking for bugs and signs of poor quality.

newstyle.py  (pylint-2.14.2):newstyle.py  (pylint-2.14.3)
skipping to change at line 110 skipping to change at line 110
self.add_message( self.add_message(
"bad-super-call", node=call, args=("self.__class__",) "bad-super-call", node=call, args=("self.__class__",)
) )
continue continue
try: try:
supcls = call.args and next(call.args[0].infer(), None) supcls = call.args and next(call.args[0].infer(), None)
except astroid.InferenceError: except astroid.InferenceError:
continue continue
if klass is not supcls: # If the supcls is in the ancestors of klass super can be used t
o skip
# a step in the mro() and get a method from a higher parent
if klass is not supcls and all(i != supcls for i in klass.ancest
ors()):
name = None name = None
# if supcls is not Uninferable, then supcls was inferred # if supcls is not Uninferable, then supcls was inferred
# and use its name. Otherwise, try to look # and use its name. Otherwise, try to look
# for call.args[0].name # for call.args[0].name
if supcls: if supcls:
name = supcls.name name = supcls.name
elif call.args and hasattr(call.args[0], "name"): elif call.args and hasattr(call.args[0], "name"):
name = call.args[0].name name = call.args[0].name
if name: if name:
self.add_message("bad-super-call", node=call, args=(name ,)) self.add_message("bad-super-call", node=call, args=(name ,))
 End of changes. 1 change blocks. 
1 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)