diff options
author | Robert Schweizer <robert_schweizer@gmx.de> | 2019-08-15 12:53:20 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-09-10 10:50:08 +0200 |
commit | fb81d1ade4f0c87039c828f9aed94469691d825d (patch) | |
tree | a1446556a10fbdcdb3df1af50139faab64b6707c /pylint/checkers/newstyle.py | |
parent | ca54a1a87f6382c68287ebc1996312ceb921f16c (diff) | |
download | pylint-git-fb81d1ade4f0c87039c828f9aed94469691d825d.tar.gz |
Report unnecessary else after continue and break
Close #2327
Diffstat (limited to 'pylint/checkers/newstyle.py')
-rw-r--r-- | pylint/checkers/newstyle.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py index bc4947c6e..5985e222d 100644 --- a/pylint/checkers/newstyle.py +++ b/pylint/checkers/newstyle.py @@ -79,18 +79,14 @@ class NewStyleConflictChecker(BaseChecker): ): continue - if not klass.newstyle and has_known_bases(klass): - # super should not be used on an old style class - continue - else: + # super should not be used on an old style class + if klass.newstyle or not has_known_bases(klass): # super first arg should be the class if not call.args: - if sys.version_info[0] == 3: + if sys.version_info[0] == 2: # unless Python 3 - continue - else: self.add_message("missing-super-argument", node=call) - continue + continue # calling super(type(self), self) can lead to recursion loop # in derived classes |