Skip to content

Commit

Permalink
fix: fixup coverage.__version__ comparisons (#208)
Browse files Browse the repository at this point in the history
Two bugs:
  * __version__ is type str; pypy3 throws exception comparing str with int
  * __version__[1] == '.', not the minor version number
  • Loading branch information
ArturKlauser authored and TheKevJames committed Dec 3, 2019
1 parent d65e609 commit 03a57a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions coveralls/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def report(self, morfs=None):
if cu.should_be_python() and not self.config.ignore_errors:
log.warning('Source file is not python %s', cu.filename)
except KeyError:
cov3x = __version__[0] < 4
cov40 = __version__[0] == 4 and __version__[1] < 1
version = [int(x) for x in __version__.split('.')]
cov3x = version[0] < 4
cov40 = version[0] == 4 and version[1] < 1
if cov3x or cov40:
raise CoverallsException(
'Old (<4.1) versions of coverage.py do not work '
Expand Down

0 comments on commit 03a57a9

Please sign in to comment.