summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-01-19 10:16:07 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-01-19 10:16:07 -0500
commitf0a4a26688f3532a31e48549bcf758a48d15581b (patch)
treea0f5a45b020594d4e5796f3ed5513693997b3d8d /coverage/misc.py
parent518d7af6189c6139bad3ac393cd41d8795bb7d4d (diff)
downloadpython-coveragepy-f0a4a26688f3532a31e48549bcf758a48d15581b.tar.gz
More pep8 compliance
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index 875d904..02fb10e 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.