summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-03-04 08:02:56 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-03-04 08:02:56 -0500
commit7dfb4859633a215d584d14a4e11465492b4ac265 (patch)
tree678300b34f4257fea6cbdf45e895c587badba8da /coverage/control.py
parent4ecb292bd474a2efa4965e47a077eb584bd9aff2 (diff)
downloadpython-coveragepy-git-7dfb4859633a215d584d14a4e11465492b4ac265.tar.gz
Small steps in refactoring initialization
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 40c22667..d42cbdcb 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -197,6 +197,8 @@ class Coverage(object):
if self._inited:
return
+ self._inited = True
+
# Create and configure the debugging controller. COVERAGE_DEBUG_FILE
# is an environment variable, the name of a file to append debug logs
# to.
@@ -329,8 +331,6 @@ class Coverage(object):
atexit.register(self._atexit)
- self._inited = True
-
# Create the matchers we need for _should_trace
if self.source or self.source_pkgs:
self.source_match = TreeMatcher(self.source)
@@ -346,6 +346,10 @@ class Coverage(object):
self.omit_match = FnmatchMatcher(self.omit)
# The user may want to debug things, show info if desired.
+ self._write_startup_debug()
+
+ def _write_startup_debug(self):
+ """Write out debug info at startup if needed."""
wrote_any = False
with self.debug.without_callers():
if self.debug.should('config'):