# HG changeset patch # User osimons # Date 1260359575 0 # Node ID 8ca05f45ed2e75f02ae09a13e478fbc0342f1be8 # Parent 3a665b40073c297177fba1bb49f076eff2d773b0 Fix a potential `ZeroDivisionError` in figleaf command. Closes #509. Thanks to Andrea Tomasini and Felix Schwarz. diff --git a/bitten/build/pythontools.py b/bitten/build/pythontools.py --- 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 = []