Skip to content

Commit

Permalink
Merge pull request #259 from Tirzono/master
Browse files Browse the repository at this point in the history
Make teamcity-message compatibility with pylint >=2.12
  • Loading branch information
mikekidya authored Dec 14, 2021
2 parents c8bf6e2 + e7f7334 commit 3292e01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion teamcity/pylint_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ def handle_message(self, msg):
def display_reports(self, layout):
"""Issues the final PyLint score as a TeamCity build statistic value"""
try:
score = self.linter.stats['global_note']
stats = self.linter.stats
score = getattr(stats, 'global_note', None)

# Backwards compatibility for pylint version <2.12
if score is None:
score = stats['global_note']
except (AttributeError, KeyError):
pass
else:
Expand Down

0 comments on commit 3292e01

Please sign in to comment.