Skip to content

Commit

Permalink
Update badge.py to Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Dec 6, 2018
1 parent 6a3e430 commit 8fd1756
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ generate_coverage_badge() {
log_info "Generating code coverage badge"
CORE_REPORT=uhabits-core/build/reports/jacoco/test/jacocoTestReport.xml
rm -f ${OUTPUTS_DIR}/coverage-badge.svg
python tools/coverage-badge/badge.py -i $CORE_REPORT -o ${OUTPUTS_DIR}/coverage-badge
python3 tools/coverage-badge/badge.py -i $CORE_REPORT -o ${OUTPUTS_DIR}/coverage-badge
}

fetch_artifacts() {
Expand Down
2 changes: 1 addition & 1 deletion tools/coverage-badge/badge.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_total(report):
missed = 0
covered = 0
for r in report.split(":"):
doc = BeautifulSoup(file(r), 'xml')
doc = BeautifulSoup(open(r), 'xml')
tag = doc.select("report > counter[type^INST]")[0]
missed = missed + float(tag['missed'])
covered = covered + float(tag['covered'])
Expand Down

0 comments on commit 8fd1756

Please sign in to comment.