summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'coverage')
-rw-r--r--coverage/cmdline.py8
-rw-r--r--coverage/exceptions.py8
-rw-r--r--coverage/execfile.py4
-rw-r--r--coverage/parser.py4
4 files changed, 12 insertions, 12 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 13783d76..d0cd4625 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -19,7 +19,7 @@ from coverage import env
from coverage.collector import CTracer
from coverage.data import CoverageData, combinable_files, line_counts
from coverage.debug import info_formatter, info_header, short_stack
-from coverage.exceptions import BaseCoverageException, ExceptionDuringRun, NoSource
+from coverage.exceptions import _BaseCoverageException, _ExceptionDuringRun, NoSource
from coverage.execfile import PyRunner
from coverage.misc import human_sorted, plural
from coverage.results import Numbers, should_fail_under
@@ -899,13 +899,13 @@ def main(argv=None):
argv = sys.argv[1:]
try:
status = CoverageScript().command_line(argv)
- except ExceptionDuringRun as err:
+ except _ExceptionDuringRun as err:
# An exception was caught while running the product code. The
- # sys.exc_info() return tuple is packed into an ExceptionDuringRun
+ # sys.exc_info() return tuple is packed into an _ExceptionDuringRun
# exception.
traceback.print_exception(*err.args) # pylint: disable=no-value-for-parameter
status = ERR
- except BaseCoverageException as err:
+ except _BaseCoverageException as err:
# A controlled error inside coverage.py: print the message to the user.
msg = err.args[0]
print(msg)
diff --git a/coverage/exceptions.py b/coverage/exceptions.py
index 6631e1ad..de2257a1 100644
--- a/coverage/exceptions.py
+++ b/coverage/exceptions.py
@@ -4,12 +4,12 @@
"""Exceptions coverage.py can raise."""
-class BaseCoverageException(Exception):
+class _BaseCoverageException(Exception):
"""The base of all Coverage exceptions."""
pass
-class CoverageException(BaseCoverageException):
+class CoverageException(_BaseCoverageException):
"""An exception raised by a coverage.py function."""
pass
@@ -29,7 +29,7 @@ class NotPython(CoverageException):
pass
-class ExceptionDuringRun(CoverageException):
+class _ExceptionDuringRun(CoverageException):
"""An exception happened while running customer code.
Construct it with three arguments, the values from `sys.exc_info`.
@@ -38,7 +38,7 @@ class ExceptionDuringRun(CoverageException):
pass
-class StopEverything(BaseCoverageException):
+class _StopEverything(_BaseCoverageException):
"""An exception that means everything should stop.
The CoverageTest class converts these to SkipTest, so that when running
diff --git a/coverage/execfile.py b/coverage/execfile.py
index 38dc1d07..2ee2f725 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -13,7 +13,7 @@ import sys
import types
from coverage import env
-from coverage.exceptions import CoverageException, ExceptionDuringRun, NoCode, NoSource
+from coverage.exceptions import CoverageException, _ExceptionDuringRun, NoCode, NoSource
from coverage.files import canonical_filename, python_reported_file
from coverage.misc import isolate_module
from coverage.phystokens import compile_unicode
@@ -233,7 +233,7 @@ class PyRunner:
err2.__traceback__ = err2.__traceback__.tb_next
sys.__excepthook__(typ2, err2, tb2.tb_next)
sys.stderr.write("\nOriginal exception was:\n")
- raise ExceptionDuringRun(typ, err, tb.tb_next) from exc
+ raise _ExceptionDuringRun(typ, err, tb.tb_next) from exc
else:
sys.exit(1)
finally:
diff --git a/coverage/parser.py b/coverage/parser.py
index d17d7c9b..665360fa 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -13,7 +13,7 @@ import tokenize
from coverage import env
from coverage.bytecode import code_objects
from coverage.debug import short_stack
-from coverage.exceptions import NoSource, NotPython, StopEverything
+from coverage.exceptions import NoSource, NotPython, _StopEverything
from coverage.misc import contract, join_regex, new_contract, nice_pair, one_of
from coverage.phystokens import compile_unicode, generate_tokens, neuter_encoding_declaration
@@ -356,7 +356,7 @@ class ByteParser:
# attributes on code objects that we need to do the analysis.
for attr in ['co_lnotab', 'co_firstlineno']:
if not hasattr(self.code, attr):
- raise StopEverything( # pragma: only jython
+ raise _StopEverything( # pragma: only jython
"This implementation of Python doesn't support code analysis.\n" +
"Run coverage.py under another Python for this command."
)