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
commit97fae250fffb33a7dfa0b2a5504d68fcdb26ed2f (patch)
tree9cc821d314bb540bd7ad2e6d184d27a18b2feff3 /coverage/control.py
parent055d04275eec87a3e6fa99838e731dfc557da60d (diff)
downloadpython-coveragepy-97fae250fffb33a7dfa0b2a5504d68fcdb26ed2f.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 40c2266..d42cbdc 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'):