diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-19 10:16:07 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-19 10:16:07 -0500 |
commit | cf5a9f0e6001cae65e57d6592cced37a460ea642 (patch) | |
tree | 422b89ad604dbeaece0f0c2bb9c6e688e5841106 /coverage/misc.py | |
parent | 9304efd307f88e358629059d939c214c1ec720fa (diff) | |
download | python-coveragepy-git-cf5a9f0e6001cae65e57d6592cced37a460ea642.tar.gz |
More pep8 compliance
Diffstat (limited to 'coverage/misc.py')
-rw-r--r-- | coverage/misc.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/coverage/misc.py b/coverage/misc.py index 875d904a..02fb10ef 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -42,7 +42,7 @@ def format_lines(statements, lines): lines = sorted(lines) while i < len(statements) and j < len(lines): if statements[i] == lines[j]: - if start == None: + if start is None: start = lines[j] end = lines[j] j += 1 @@ -59,7 +59,7 @@ def format_lines(statements, lines): def short_stack(): # pragma: debugging """Return a string summarizing the call stack.""" stack = inspect.stack()[:0:-1] - return "\n".join("%30s : %s @%d" % (t[3],t[1],t[2]) for t in stack) + return "\n".join("%30s : %s @%d" % (t[3], t[1], t[2]) for t in stack) def expensive(fn): @@ -69,6 +69,7 @@ def expensive(fn): """ attr = "_cache_" + fn.__name__ + def _wrapped(self): """Inner fn that checks the cache.""" if not hasattr(self, attr): @@ -165,18 +166,22 @@ class CoverageException(Exception): """An exception specific to Coverage.""" pass + class NoSource(CoverageException): """We couldn't find the source for a module.""" pass + class NoCode(NoSource): """We couldn't find any code at all.""" pass + class NotPython(CoverageException): """A source file turned out not to be parsable Python.""" pass + class ExceptionDuringRun(CoverageException): """An exception happened while running customer code. |