changeset 721:8ca05f45ed2e

Fix a potential `ZeroDivisionError` in figleaf command. Closes #509. Thanks to Andrea Tomasini and Felix Schwarz.
author osimons
date Wed, 09 Dec 2009 11:52:55 +0000
parents 3a665b40073c
children 278c0ddb5c58
files bitten/build/pythontools.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/build/pythontools.py
+++ b/bitten/build/pythontools.py
@@ -399,6 +399,8 @@
         modname = base.replace(os.path.sep, '.')
         realfilename = ctxt.resolve(filename)
         interesting_lines = get_lines(open(realfilename))
+        if not interesting_lines:
+            continue
         covered_lines = coverage_data.get(realfilename, set())
         percentage = int(round(len(covered_lines) * 100 / len(interesting_lines)))
         line_hits = []
Copyright (C) 2012-2017 Edgewall Software