From 2c883bf322dfaa6173efda3805b402b3c0ad1dbb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2009 17:02:26 -0500 Subject: A little more detail on how stuff works. --- coverage/control.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 24fed7b9..674bb15e 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -88,15 +88,22 @@ class coverage(object): # The prefix for files considered "installed with the interpreter". if not self.cover_pylib: + # Look at where the "os" module is located. That's the indication + # for "installed with the interpreter". os_file = self.file_locator.canonical_filename(os.__file__) self.pylib_prefix = os.path.split(os_file)[0] + # To avoid tracing the coverage code itself, we skip anything located + # where we are. here = self.file_locator.canonical_filename(__file__) self.cover_prefix = os.path.split(here)[0] def _should_trace(self, filename, frame): """Decide whether to trace execution in `filename` + This function is called from the trace function. As each new file name + is encountered, this function determines whether it is traced or not. + Returns a canonicalized filename if it should be traced, False if it should not. -- cgit v1.2.1