diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-13 20:12:05 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-13 20:12:05 -0500 |
commit | 78e2e6eb38d229cfcd4d0202f27761cd5bab2495 (patch) | |
tree | 93866af62ea60710682aaa5a6e709b55cd29b69b /coverage/misc.py | |
parent | 543ff12a09952b132abd9aa863d4170c4e2523f4 (diff) | |
parent | a5e4aa218a749f9ea73bccea4cac92bd35387451 (diff) | |
download | python-coveragepy-78e2e6eb38d229cfcd4d0202f27761cd5bab2495.tar.gz |
Merged Ben Finney's use-os-path-module fixes (again?)
Diffstat (limited to 'coverage/misc.py')
-rw-r--r-- | coverage/misc.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/coverage/misc.py b/coverage/misc.py index 0e6bcf9..4218536 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -60,6 +60,14 @@ def expensive(fn): return _wrapped +def bool_or_none(b): + """Return bool(b), but preserve None.""" + if b is None: + return None + else: + return bool(b) + + class CoverageException(Exception): """An exception specific to Coverage.""" pass @@ -67,3 +75,11 @@ class CoverageException(Exception): class NoSource(CoverageException): """Used to indicate we couldn't find the source for a module.""" pass + +class ExceptionDuringRun(CoverageException): + """An exception happened while running customer code. + + Construct it with three arguments, the values from `sys.exc_info`. + + """ + pass |